From 5335e70d154100e51ddbc6686f58c8e14453316f Mon Sep 17 00:00:00 2001 From: "David H. Sianturi" Date: Tue, 3 Mar 2020 23:44:03 +0700 Subject: [PATCH] Add a shortcut to open the spotlight. --- resources/js/components/SidebarMenu.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/resources/js/components/SidebarMenu.vue b/resources/js/components/SidebarMenu.vue index 32c8610..d7245a9 100644 --- a/resources/js/components/SidebarMenu.vue +++ b/resources/js/components/SidebarMenu.vue @@ -20,6 +20,7 @@ export default { mounted() { this.loadRequests(); + this.spotlightWithKey(); }, methods: { @@ -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(); + } + } } } }