diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/App.vue | 1 | ||||
-rw-r--r-- | src/components/SearchInput.vue | 10 |
2 files changed, 9 insertions, 2 deletions
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 @@ | |||
41 | 41 | ||
42 | <SearchInput | 42 | <SearchInput |
43 | class="navbar-item is-inline-block-mobile" | 43 | class="navbar-item is-inline-block-mobile" |
44 | :hotkey="config.hotkey" | ||
44 | @input="filterServices" | 45 | @input="filterServices" |
45 | @search-focus="showMenu = true" | 46 | @search-focus="showMenu = true" |
46 | @search-open="navigateToFirstService" | 47 | @search-open="navigateToFirstService" |
diff --git a/src/components/SearchInput.vue b/src/components/SearchInput.vue index 40c5a1d..c4c11a2 100644 --- a/src/components/SearchInput.vue +++ b/src/components/SearchInput.vue | |||
@@ -15,10 +15,16 @@ | |||
15 | <script> | 15 | <script> |
16 | export default { | 16 | export default { |
17 | name: "SearchInput", | 17 | name: "SearchInput", |
18 | props: ["value"], | 18 | props: { |
19 | value: String, | ||
20 | hotkey: { | ||
21 | type: String, | ||
22 | default: "/" | ||
23 | } | ||
24 | }, | ||
19 | mounted() { | 25 | mounted() { |
20 | this._keyListener = function (event) { | 26 | this._keyListener = function (event) { |
21 | if (event.key === "/") { | 27 | if (event.key === this.hotkey) { |
22 | event.preventDefault(); | 28 | event.preventDefault(); |
23 | this.focus(); | 29 | this.focus(); |
24 | } | 30 | } |