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
commite706a5f14fa134eb13361e41f73e7d1c87e0ce63 (patch)
tree2702890db9789efbe9b837910d9928c7c87c86aa
parenta8b8b4e3f894ba1a8df883db492c53e925f06bc4 (diff)
fix: console error when post nav is not present
Former-commit-id: 2b546a57852cacbfb3f204d5b552a039440478fb
-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>