fix: js error when no results found
Alan Pearce alan@alanpearce.eu
Sun, 12 May 2024 12:49:47 +0200
1 files changed, 6 insertions(+), 2 deletions(-)
jump to
M frontend/static/search.js → frontend/static/search.js
@@ -56,8 +56,12 @@ results = fragment.querySelector("#results"); 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) {