From 3ecf4ff3a06880958df14e528208f2ea582bf370 Mon Sep 17 00:00:00 2001 From: booploops <49113086+booploops@users.noreply.github.com> Date: Thu, 16 Dec 2021 02:11:25 -0800 Subject: [PATCH] CTRL + F will now focus and select the search box --- resources/cider-ui/index.js | 9 +++++++++ resources/cider-ui/views/main.ejs | 1 + 2 files changed, 10 insertions(+) diff --git a/resources/cider-ui/index.js b/resources/cider-ui/index.js index 457c3d37..82f6e02f 100644 --- a/resources/cider-ui/index.js +++ b/resources/cider-ui/index.js @@ -1817,6 +1817,15 @@ const app = new Vue({ } } }) + +// Key binds +document.addEventListener('keydown', function (e) { + if (e.keyCode === 70 && e.ctrlKey) { + app.$refs.searchInput.focus() + app.$refs.searchInput.select() + } +}); + // Hang Timer app.hangtimer = setTimeout(()=>{ if(confirm("Cider is not responding. Reload the app?")) { diff --git a/resources/cider-ui/views/main.ejs b/resources/cider-ui/views/main.ejs index f2f6576a..ebf26982 100644 --- a/resources/cider-ui/views/main.ejs +++ b/resources/cider-ui/views/main.ejs @@ -142,6 +142,7 @@ v-on:keyup.enter="searchQuery();search.showHints = false" @change="showSearch();" @input="getSearchHints()" placeholder="Search..." v-model="search.term" + ref="searchInput" class="search-input">