mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-27 07:14:26 +01:00
stop requestings the facets if the user has hidden them
This commit is contained in:
parent
bcc131e866
commit
13ce0ebb87
@ -1,5 +1,6 @@
|
|||||||
var request = null;
|
var request = null;
|
||||||
var timeoutID = null;
|
var timeoutID = null;
|
||||||
|
var display_facets = false;
|
||||||
|
|
||||||
$('#query, #filters').on('input', function () {
|
$('#query, #filters').on('input', function () {
|
||||||
var query = $('#query').val();
|
var query = $('#query').val();
|
||||||
@ -18,7 +19,7 @@ $('#query, #filters').on('input', function () {
|
|||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
'query': query,
|
'query': query,
|
||||||
'filters': filters,
|
'filters': filters,
|
||||||
"facetDistribution": true,
|
"facetDistribution": display_facets,
|
||||||
}),
|
}),
|
||||||
contentType: 'application/json',
|
contentType: 'application/json',
|
||||||
success: function (data, textStatus, request) {
|
success: function (data, textStatus, request) {
|
||||||
@ -114,7 +115,6 @@ function selectedFacetsToArray(facets_obj) {
|
|||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
display_facets = false;
|
|
||||||
$('#display_facets').click(function() {
|
$('#display_facets').click(function() {
|
||||||
if (display_facets) {
|
if (display_facets) {
|
||||||
display_facets = false;
|
display_facets = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user