From ce0a0fcb3cbfe10c6e6031c2be263ec2f432aa84 Mon Sep 17 00:00:00 2001 From: "Herbert Wolverson (aider)" Date: Wed, 26 Feb 2025 10:14:55 -0600 Subject: [PATCH] feat: add '/' key shortcut to focus search input --- .../lqosd/src/node_manager/js_build/src/template.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/rust/lqosd/src/node_manager/js_build/src/template.js b/src/rust/lqosd/src/node_manager/js_build/src/template.js index 2939ce753..27efa644c 100644 --- a/src/rust/lqosd/src/node_manager/js_build/src/template.js +++ b/src/rust/lqosd/src/node_manager/js_build/src/template.js @@ -76,6 +76,14 @@ function setupSearch() { const search = $("#txtSearch").val(); doSearch(search); }); + + // Add this new key handler for '/' to focus search + $(document).on('keydown', (e) => { + if (e.key === '/' && !$(e.target).is('input, textarea, select')) { + e.preventDefault(); + $('#txtSearch').focus(); + } + }); } function setupReload() { @@ -95,4 +103,4 @@ initDayNightMode(); initRedact(); getDeviceCounts(); setupSearch(); -setupReload(); \ No newline at end of file +setupReload();