summaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-04-02 14:24:40 +0800
committerEltrac <hi@guhub.cn>2025-04-02 14:24:40 +0800
commit27af269ad0a26e858217b71ba5d4697bdb791ae8 (patch)
tree797501a27d1de0e58377b08505908683cee776e0 /layouts
parent139e2aeaf35c73e32b746f7373a817313744ab1e (diff)
feat: double-click to turn off global search
also clearer comment
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/components/global-search.html6
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>