diff options
| author | Eltrac <hi@guhub.cn> | 2025-04-02 14:24:40 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-04-02 14:24:40 +0800 |
| commit | 6581552a1201ceabec5595cd2f31138e39e1bd1a (patch) | |
| tree | 7c119f9d78b8b26199a20d25d29cee462d5ad108 | |
| parent | db127b598d0c01b7a07933d3369b4d1dd7c0c9e0 (diff) | |
feat: double-click to turn off global search
also clearer comment
Former-commit-id: 27af269ad0a26e858217b71ba5d4697bdb791ae8
| -rw-r--r-- | layouts/partials/components/global-search.html | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/layouts/partials/components/global-search.html b/layouts/partials/components/global-search.html index 9311416d..5b158abe 100644 --- a/layouts/partials/components/global-search.html +++ b/layouts/partials/components/global-search.html @@ -106,9 +106,15 @@ } }); + // trigger by clicking instruction text + // to allow mobile users to search const searchInstruction = document.getElementById("search-instruction"); if (searchInstruction) { searchInstruction.addEventListener("click", turnOn); } + + // double-click to turn off search + // in case esc and ctrl/cmd+k cannot be used + search.addEventListener("dblclick", turnOff); })(); </script> |
