mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-25 03:15:24 +00:00
enhancement: hide slider on escape key
Signed-off-by: Pranav C <pranavxc@gmail.com>
This commit is contained in:
@@ -26,9 +26,22 @@ export default {
|
||||
mounted() {
|
||||
(document.querySelector('[data-app]') || this.$root.$el).append(this.$el)
|
||||
},
|
||||
|
||||
destroyed() {
|
||||
this.$el.parentNode && this.$el.parentNode.removeChild(this.$el)
|
||||
},
|
||||
created() {
|
||||
document.body.addEventListener('keyup', this.onKeyup, true)
|
||||
},
|
||||
beforeDestroy() {
|
||||
document.body.removeEventListener('keyup', this.onKeyup, true)
|
||||
},
|
||||
|
||||
methods: {
|
||||
onKeyup(e) {
|
||||
if (e.key === 'Escape') {
|
||||
this.modal = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user