Skip to content

Commit 6b8edea

Browse files
committed
Update to 2.1.20
1 parent 688fc31 commit 6b8edea

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

dist/itemsjs.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20646,6 +20646,7 @@ var getBuckets = function getBuckets(data, input, aggregations) {
2064620646
var title;
2064720647
var show_facet_stats;
2064820648
var chosen_filters_on_top;
20649+
var hide_zero_doc_count;
2064920650

2065020651
if (aggregations[k]) {
2065120652
order = aggregations[k].order;
@@ -20654,6 +20655,7 @@ var getBuckets = function getBuckets(data, input, aggregations) {
2065420655
title = aggregations[k].title;
2065520656
show_facet_stats = aggregations[k].show_facet_stats || false;
2065620657
chosen_filters_on_top = aggregations[k].chosen_filters_on_top !== false;
20658+
hide_zero_doc_count = aggregations[k].hide_zero_doc_count || false;
2065720659
}
2065820660

2065920661
var buckets = _.chain(v).toPairs().map(function (v2) {
@@ -20663,12 +20665,18 @@ var getBuckets = function getBuckets(data, input, aggregations) {
2066320665
filters = input.filters[k];
2066420666
}
2066520667

20668+
var doc_count = v2[1].array().length;
20669+
20670+
if (hide_zero_doc_count && doc_count === 0) {
20671+
return;
20672+
}
20673+
2066620674
return {
2066720675
key: v2[0],
20668-
doc_count: v2[1].array().length,
20676+
doc_count: doc_count,
2066920677
selected: filters.indexOf(v2[0]) !== -1
2067020678
};
20671-
}).value();
20679+
}).compact().value();
2067220680

2067320681
var iteratees;
2067420682
var sort_order;

dist/itemsjs.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "itemsjs",
3-
"version": "2.1.19",
3+
"version": "2.1.20",
44
"description": "Created to perform fast search on small json dataset (up to 1000 elements).",
55
"main": "lib/index.js",
66
"scripts": {

0 commit comments

Comments
 (0)