refactoring part 3

This commit is contained in:
Peter Papp
2021-08-23 16:31:25 +02:00
parent 42210233dc
commit 527a0790e3
12 changed files with 441 additions and 332 deletions

View File

@@ -57,7 +57,12 @@ export default {
const webApp = document.getElementsByTagName("html")[0];
webApp.classList.toggle("dark-mode");
}
},
spotlightListener(e) {
if (e.key === 'k' && e.metaKey) {
events.$emit('spotlight:show');
}
},
},
beforeMount() {
@@ -111,7 +116,12 @@ export default {
if (this.$isWIndows()) {
document.body.classList.add('windows')
}
}
window.addEventListener("keydown", this.spotlightListener);
},
destroyed() {
window.removeEventListener("keydown", this.spotlightListener);
}
}
</script>