aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRobin Schneider <robin-schneider@outlook.de>2021-09-11 12:42:57 +0200
committerRobin Schneider <robin-schneider@outlook.de>2021-09-11 12:42:57 +0200
commit584f2b4b32e69865d9561f1537142791710f676d (patch)
treee56da69a2f4793a65171a99dd234de2bcae0bc51
parent6b54eedae7bf2632fbb1ec1d9419a7b71cf102cc (diff)
downloadhomer-584f2b4b32e69865d9561f1537142791710f676d.tar.gz
homer-584f2b4b32e69865d9561f1537142791710f676d.tar.zst
homer-584f2b4b32e69865d9561f1537142791710f676d.zip
Added custom hotkey support
-rw-r--r--docs/configuration.md2
-rw-r--r--src/App.vue1
-rw-r--r--src/components/SearchInput.vue10
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"
19# icon: "fas fa-skull-crossbones" 19# icon: "fas fa-skull-crossbones"
20 20
21header: true # Set to false to hide the header 21header: true # Set to false to hide the header
22# Optional: Different hotkey for search, defaults to "/"
23# hotkey: "Shift"
22footer: '<p>Created with <span class="has-text-danger">❤️</span> with <a href="https://bulma.io/">bulma</a>, <a href="https://vuejs.org/">vuejs</a> & <a href="https://fontawesome.com/">font awesome</a> // Fork me on <a href="https://github.com/bastienwirtz/homer"><i class="fab fa-github-alt"></i></a></p>' # set false if you want to hide it. 24footer: '<p>Created with <span class="has-text-danger">❤️</span> with <a href="https://bulma.io/">bulma</a>, <a href="https://vuejs.org/">vuejs</a> & <a href="https://fontawesome.com/">font awesome</a> // Fork me on <a href="https://github.com/bastienwirtz/homer"><i class="fab fa-github-alt"></i></a></p>' # set false if you want to hide it.
23 25
24columns: "3" # "auto" or number (must be a factor of 12: 1, 2, 3, 4, 6, 12) 26columns: "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 @@
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>
16export default { 16export 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 }