summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-04-02 13:54:25 +0800
committerEltrac <hi@guhub.cn>2025-04-02 13:54:25 +0800
commit2b546a57852cacbfb3f204d5b552a039440478fb (patch)
treec2bf88dc1a6b76159750848f17d36d57cfdbcb3f
parent8a1bde960bf31c52327a17fbd9df0bdfa23b61c4 (diff)
fix: console error when post nav is not present
-rw-r--r--layouts/partials/components/global-search.html6
1 files changed, 3 insertions, 3 deletions
diff --git a/layouts/partials/components/global-search.html b/layouts/partials/components/global-search.html
index c1051ee4..9311416d 100644
--- a/layouts/partials/components/global-search.html
+++ b/layouts/partials/components/global-search.html
@@ -107,8 +107,8 @@
});
const searchInstruction = document.getElementById("search-instruction");
- searchInstruction.addEventListener("click", (event) => {
- turnOn();
- });
+ if (searchInstruction) {
+ searchInstruction.addEventListener("click", turnOn);
+ }
})();
</script>