From 08d50036909a3193cf9c0ff24572c41bc5aaf4e8 Mon Sep 17 00:00:00 2001 From: c8h_ <78642782+c8hunderscore@users.noreply.github.com> Date: Sat, 6 Nov 2021 20:52:32 +0000 Subject: [PATCH] "/" to search You can press the slash key to focus the main search bar. --- static/src/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/static/src/index.js b/static/src/index.js index 746ae2d7..c7e8bf81 100644 --- a/static/src/index.js +++ b/static/src/index.js @@ -200,6 +200,11 @@ async function home() { `; } }); + document.body.addEventListener('keyup', function(event) { + if (event.keyCode == 191) { + document.querySelector('input').focus(); + }; + }); }; }; @@ -235,4 +240,4 @@ function parseCookies(str = '') { const map = new Map(); str.split('; ').forEach(cookie => map.set(...cookie.split('='))); return map; -}; \ No newline at end of file +};