diff --git a/docs/configuration.md b/docs/configuration.md index 50b5bd5..e2b5506 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -19,6 +19,9 @@ 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: +# 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 c263c8a..5c62a7f 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(); } @@ -28,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;