diff --git a/client/src/ui/components/BdSettingsWrapper.vue b/client/src/ui/components/BdSettingsWrapper.vue index 832929d9..36234d34 100644 --- a/client/src/ui/components/BdSettingsWrapper.vue +++ b/client/src/ui/components/BdSettingsWrapper.vue @@ -40,6 +40,7 @@ hideSettings() { this.active = false }, toggleSettings() { this.active = !this.active }, keyupListener(e) { + if (document.getElementsByClassName('bd-backdrop').length) return; if (this.active && e.which === 27) return this.hideSettings(); if (!e.metaKey && !e.ctrlKey || e.key !== 'b') return; this.toggleSettings(); diff --git a/client/src/ui/components/common/Modal.vue b/client/src/ui/components/common/Modal.vue index 0c2eb037..4966693a 100644 --- a/client/src/ui/components/common/Modal.vue +++ b/client/src/ui/components/common/Modal.vue @@ -44,6 +44,20 @@ return { scrolled: false }; + }, + beforeMount() { + window.addEventListener('keyup', this.keyupListener); + }, + destroyed() { + window.removeEventListener('keyup', this.keyupListener); + }, + methods: { + keyupListener(e) { + console.log('key up!'); + if (e.which === 27) { + this.close(); + } + } } }