Skip to content

Commit

Permalink
Add a shortcut to open the spotlight.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhsianturi committed Mar 4, 2020
1 parent f352a0c commit 5335e70
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions resources/js/components/SidebarMenu.vue
Expand Up @@ -20,6 +20,7 @@ export default {
mounted() {
this.loadRequests();
this.spotlightWithKey();
},
methods: {
Expand All @@ -36,6 +37,14 @@ export default {
},
openSpotlight() {
this.$root.spotlight.open = true;
},
spotlightWithKey() {
document.onkeyup = e => {
if (e.ctrlKey && e.code == 'Space') {
e.preventDefault();
this.openSpotlight();
}
}
}
}
}
Expand Down

0 comments on commit 5335e70

Please sign in to comment.