Skip to content

Commit

Permalink
Set current_term earlier in search JS
Browse files Browse the repository at this point in the history
Closes #1856
  • Loading branch information
Keats committed Jun 10, 2022
1 parent 0949007 commit 570e2fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/static/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ function initSearch() {
}
$searchResults.style.display = term === "" ? "none" : "block";
$searchResultsItems.innerHTML = "";
currentTerm = term;
if (term === "") {
return;
}
Expand All @@ -161,7 +162,6 @@ function initSearch() {
return;
}

currentTerm = term;
for (var i = 0; i < Math.min(results.length, MAX_ITEMS); i++) {
var item = document.createElement("li");
item.innerHTML = formatSearchResultItem(results[i], term.split(" "));
Expand Down

0 comments on commit 570e2fc

Please sign in to comment.