From 584f2b4b32e69865d9561f1537142791710f676d Mon Sep 17 00:00:00 2001 From: Robin Schneider Date: Sat, 11 Sep 2021 12:42:57 +0200 Subject: Added custom hotkey support --- docs/configuration.md | 2 ++ src/App.vue | 1 + src/components/SearchInput.vue | 10 ++++++++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index a472b41..93abadb 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -19,6 +19,8 @@ logo: "assets/logo.png" # icon: "fas fa-skull-crossbones" header: true # Set to false to hide the header +# Optional: Different hotkey for search, defaults to "/" +# hotkey: "Shift" footer: '

Created with ❤️ with bulma, vuejs & font awesome // Fork me on

' # set false if you want to hide it. columns: "3" # "auto" or number (must be a factor of 12: 1, 2, 3, 4, 6, 12) diff --git a/src/App.vue b/src/App.vue index 1f4f509..9b4803f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -41,6 +41,7 @@ export default { name: "SearchInput", - props: ["value"], + props: { + value: String, + hotkey: { + type: String, + default: "/" + } + }, mounted() { this._keyListener = function (event) { - if (event.key === "/") { + if (event.key === this.hotkey) { event.preventDefault(); this.focus(); } -- cgit v1.2.3 From b64b17a4f91669713328cecada81482ba97cea38 Mon Sep 17 00:00:00 2001 From: Robin Schneider Date: Fri, 8 Oct 2021 15:11:00 +0200 Subject: Fixed spelling --- src/components/SearchInput.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/SearchInput.vue b/src/components/SearchInput.vue index c4c11a2..586ff71 100644 --- a/src/components/SearchInput.vue +++ b/src/components/SearchInput.vue @@ -34,7 +34,7 @@ export default { }; document.addEventListener("keydown", this._keyListener.bind(this)); - // fill seach from get parameter. + // fill search from get parameter. const search = new URLSearchParams(window.location.search).get("search"); if (search) { this.$refs.search.value = search; -- cgit v1.2.3 From 1c0bf7132aedf869abd739b6eca1b489887414b2 Mon Sep 17 00:00:00 2001 From: Robin Schneider Date: Mon, 11 Oct 2021 23:54:34 +0200 Subject: Added requested changes --- docs/configuration.md | 3 ++- src/App.vue | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index 080f296..e2b5506 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -20,7 +20,8 @@ logo: "assets/logo.png" header: true # Set to false to hide the header # Optional: Different hotkey for search, defaults to "/" -# hotkey: "Shift" +# hotkey: +# search: "Shift" footer: '

Created with ❤️ with bulma, vuejs & font awesome // Fork me on

' # set false if you want to hide it. columns: "3" # "auto" or number (must be a factor of 12: 1, 2, 3, 4, 6, 12) diff --git a/src/App.vue b/src/App.vue index 5e71796..a0de338 100644 --- a/src/App.vue +++ b/src/App.vue @@ -41,7 +41,7 @@ Date: Tue, 12 Oct 2021 14:36:22 +0200 Subject: Merged main, fixed hotkey support --- src/App.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/App.vue b/src/App.vue index a0de338..5c62a7f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -41,7 +41,7 @@