aboutsummaryrefslogtreecommitdiff
path: root/assets/search.js
diff options
context:
space:
mode:
Diffstat (limited to 'assets/search.js')
-rw-r--r--assets/search.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/assets/search.js b/assets/search.js
index 0393d2c..1feb701 100644
--- a/assets/search.js
+++ b/assets/search.js
@@ -7,6 +7,10 @@
const input = document.querySelector('#book-search-input');
const results = document.querySelector('#book-search-results');
+ if (!input) {
+ return
+ }
+
input.addEventListener('focus', init);
input.addEventListener('keyup', search);