fix: move checks into timeout

v1.18.x
Barış Soner Uşaklı 5 years ago
parent a9315aee7d
commit 47d73a2ab4

@ -487,11 +487,11 @@ app.cacheBuster = null;
clearTimeout(searchTimeoutId); clearTimeout(searchTimeoutId);
searchTimeoutId = 0; searchTimeoutId = 0;
} }
searchTimeoutId = setTimeout(function () {
if (inputEl.val().length < 3 || inputEl.val() === currentVal) { if (inputEl.val().length < 3 || inputEl.val() === currentVal) {
return; return;
} }
currentVal = inputEl.val(); currentVal = inputEl.val();
searchTimeoutId = setTimeout(function () {
if (!inputEl.is(':focus')) { if (!inputEl.is(':focus')) {
return quickSearchResults.addClass('hidden'); return quickSearchResults.addClass('hidden');
} }

Loading…
Cancel
Save