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 --- src/App.vue | 1 + src/components/SearchInput.vue | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src') 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(-) (limited to 'src') 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 --- src/App.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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(-) (limited to 'src') 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 @@