Formatting
This commit is contained in:
parent
a574a75610
commit
999c1a3fa6
@ -1,5 +1,4 @@
|
||||
$(document).ready(function() {
|
||||
|
||||
var HITS_PER_PAGE = 25;
|
||||
var MAX_VALUES_PER_FACET = 30;
|
||||
|
||||
@ -28,7 +27,9 @@ $(document).ready(function() {
|
||||
$inputField.on('keyup change', function() {
|
||||
var query = $inputField.val();
|
||||
|
||||
if(query === undefined) { return; }
|
||||
if (query === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
toggleIconEmptyInput(!query.trim());
|
||||
|
||||
@ -133,12 +134,8 @@ $(document).ready(function() {
|
||||
}
|
||||
|
||||
var storeValue = function(values, label) {
|
||||
|
||||
|
||||
return function(item) {
|
||||
|
||||
let refined = search.isRefined(label, item.key);
|
||||
|
||||
values.push({
|
||||
facet: label,
|
||||
label: item.key,
|
||||
@ -151,19 +148,15 @@ $(document).ready(function() {
|
||||
|
||||
var facets = [];
|
||||
var aggs = content.aggs;
|
||||
|
||||
for (var label in aggs) {
|
||||
|
||||
let values = [];
|
||||
|
||||
let buckets = aggs[label].buckets;
|
||||
|
||||
if (buckets.length === 0) { continue; }
|
||||
|
||||
|
||||
if (buckets.length === 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
buckets.forEach(storeValue(values, label));
|
||||
|
||||
facets.push({
|
||||
title: label,
|
||||
values: values.slice(0),
|
||||
@ -172,7 +165,6 @@ $(document).ready(function() {
|
||||
|
||||
// Display facets
|
||||
var facetsHtml = '';
|
||||
|
||||
for (var indexFacet = 0; indexFacet < facets.length; ++indexFacet) {
|
||||
var facet = facets[indexFacet];
|
||||
//title, values[facet, value]
|
||||
@ -269,7 +261,6 @@ $(document).ready(function() {
|
||||
$(this).parent().find('.button-checkbox button.btn').toggleClass("hover");
|
||||
});
|
||||
|
||||
|
||||
/************
|
||||
* HELPERS
|
||||
* ***********/
|
||||
@ -342,5 +333,4 @@ $(document).ready(function() {
|
||||
// do empty search to fill aggregations
|
||||
search.setQuery('', what);
|
||||
search.execute();
|
||||
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user