hide overlays by esc shortcut

This commit is contained in:
Čarodej
2022-03-15 10:59:38 +01:00
parent 1c4b4c6279
commit d0b4b729c9
3 changed files with 13 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
<template>
<div>
<div @keydown.esc="closeOverlays" tabindex="-1">
<!--UI components-->
<Alert />
<ToasterWrapper />
@@ -72,6 +72,12 @@ export default {
}
},
methods: {
closeOverlays() {
events.$emit('popup:close')
events.$emit('popover:close')
this.$store.commit('CLOSE_NOTIFICATION_CENTER')
},
spotlightListener(e) {
if (e.key === 'k' && e.metaKey || e.key === 'k' && e.ctrlKey) {
e.preventDefault()

View File

@@ -36,6 +36,7 @@ export default {
this.isVisible = !this.isVisible
}
})
events.$on('popover:close', () => this.isVisible = false)
},
}
</script>