forked from extern/homer
Added custom hotkey support
This commit is contained in:
parent
6b54eedae7
commit
584f2b4b32
@ -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: '<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.
|
||||
|
||||
columns: "3" # "auto" or number (must be a factor of 12: 1, 2, 3, 4, 6, 12)
|
||||
|
@ -41,6 +41,7 @@
|
||||
|
||||
<SearchInput
|
||||
class="navbar-item is-inline-block-mobile"
|
||||
:hotkey="config.hotkey"
|
||||
@input="filterServices"
|
||||
@search-focus="showMenu = true"
|
||||
@search-open="navigateToFirstService"
|
||||
|
@ -15,10 +15,16 @@
|
||||
<script>
|
||||
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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user