diff options
author | Alan Pearce | 2024-05-12 12:49:47 +0200 |
---|---|---|
committer | Alan Pearce | 2024-05-12 12:49:47 +0200 |
commit | 628c2a858191cde34478b760b3c8c6c23a420088 (patch) | |
tree | 9d1b247330ff349c5adbb26013014f52cbb07e97 /frontend | |
parent | 6ea867dfa9043e9f9beedaabc195a2657254bdc8 (diff) | |
download | searchix-628c2a858191cde34478b760b3c8c6c23a420088.tar.lz searchix-628c2a858191cde34478b760b3c8c6c23a420088.tar.zst searchix-628c2a858191cde34478b760b3c8c6c23a420088.zip |
fix: js error when no results found
Diffstat (limited to 'frontend')
-rw-r--r-- | frontend/static/search.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/frontend/static/search.js b/frontend/static/search.js index edaf65f..a65e10c 100644 --- a/frontend/static/search.js +++ b/frontend/static/search.js @@ -56,8 +56,12 @@ function renderFragmentHTML(html) { pagination = fragment.querySelector("#pagination"); range.deleteContents(); range.insertNode(fragment); - addToggleEventListeners(results); - addPaginationEventListeners(pagination); + if (results !== null) { + addToggleEventListeners(results); + } + if (pagination !== null) { + addPaginationEventListeners(pagination); + } } function getResults(url) { |