From: Robin Schneider Date: Sat, 11 Sep 2021 10:42:57 +0000 (+0200) Subject: Added custom hotkey support X-Git-Tag: v22.02.1~14^2~7 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=584f2b4b32e69865d9561f1537142791710f676d;p=github%2Fbastienwirtz%2Fhomer.git Added custom hotkey support --- 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(); }