mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: don't repeat search if on same page
This commit is contained in:
@@ -590,12 +590,23 @@ app.cacheBuster = null;
|
||||
}
|
||||
});
|
||||
|
||||
let ajaxified = false;
|
||||
hooks.on('action:ajaxify.end', function () {
|
||||
if (!ajaxify.isCold()) {
|
||||
ajaxified = true;
|
||||
}
|
||||
});
|
||||
inputEl.on('focus', function () {
|
||||
mousedownOnResults = false;
|
||||
oldValue = inputEl.val();
|
||||
if (inputEl.val() && quickSearchResults.find('#quick-search-results').children().length) {
|
||||
updateCategoryFilterName();
|
||||
doSearch();
|
||||
if (ajaxified) {
|
||||
doSearch();
|
||||
ajaxified = false;
|
||||
} else {
|
||||
quickSearchResults.removeClass('hidden');
|
||||
}
|
||||
inputEl[0].setSelectionRange(0, inputEl.val().length);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user