diff options
| author | Eltrac <hi@guhub.cn> | 2025-04-02 13:54:25 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-04-02 13:54:25 +0800 |
| commit | e706a5f14fa134eb13361e41f73e7d1c87e0ce63 (patch) | |
| tree | 2702890db9789efbe9b837910d9928c7c87c86aa | |
| parent | a8b8b4e3f894ba1a8df883db492c53e925f06bc4 (diff) | |
fix: console error when post nav is not present
Former-commit-id: 2b546a57852cacbfb3f204d5b552a039440478fb
| -rw-r--r-- | layouts/partials/components/global-search.html | 6 |
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> |
