Skip to content

Commit

Permalink
fix: move variable initialization.
Browse files Browse the repository at this point in the history
  • Loading branch information
crhallberg committed Jan 10, 2024
1 parent 426c1f3 commit 8eac13d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions themes/bootstrap3/js/searchbox_controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,10 @@ VuFind.register('searchbox_controls', function SearchboxControls() {
function setupSearchResetButton() {
_resetButton = document.getElementById("searchForm-reset");

if (!_resetButton) {
if (!_resetButton || !_textInput) {
return;
}

_textInput = document.getElementById("searchForm_lookfor");

if (_textInput.value !== "") {
_resetButton.classList.remove("hidden");
}
Expand All @@ -301,6 +299,8 @@ VuFind.register('searchbox_controls', function SearchboxControls() {
}

function init() {
_textInput = document.getElementById("searchForm_lookfor");

setupAutocomplete();
setupSearchResetButton();

Expand Down

0 comments on commit 8eac13d

Please sign in to comment.