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 | 27af269ad0a26e858217b71ba5d4697bdb791ae8 (patch) | |
| tree | 797501a27d1de0e58377b08505908683cee776e0 | |
| parent | 139e2aeaf35c73e32b746f7373a817313744ab1e (diff) | |
feat: double-click to turn off global search
also clearer comment
| -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> |
