diff options
author | 2020-09-23 20:56:38 -0700 | |
---|---|---|
committer | 2020-09-23 21:01:58 -0700 | |
commit | b015887b0229d81b9041f7a3c1021d42626b6c17 (patch) | |
tree | beadebf7eed5f33086e2acddeafd1295d7c2bde6 /ui/static/js/keyboard_handler.js | |
parent | 75b11d5744bdd0a39b1fc86fcb2a815beba8d893 (diff) | |
download | v2-b015887b0229d81b9041f7a3c1021d42626b6c17.tar.gz v2-b015887b0229d81b9041f7a3c1021d42626b6c17.tar.zst v2-b015887b0229d81b9041f7a3c1021d42626b6c17.zip |
Avoid Javascript minifier to break keyboard shortcuts
Diffstat (limited to 'ui/static/js/keyboard_handler.js')
-rw-r--r-- | ui/static/js/keyboard_handler.js | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/ui/static/js/keyboard_handler.js b/ui/static/js/keyboard_handler.js index 718a4eeb..037f9949 100644 --- a/ui/static/js/keyboard_handler.js +++ b/ui/static/js/keyboard_handler.js @@ -15,10 +15,9 @@ class KeyboardHandler { let key = this.getKey(event); if (this.isEventIgnored(event, key) || this.isModifierKeyDown(event)) { return; - } else { - event.preventDefault(); } + event.preventDefault(); this.queue.push(key); for (let combination in this.shortcuts) { @@ -47,7 +46,6 @@ class KeyboardHandler { return event.target.tagName === "INPUT" || event.target.tagName === "TEXTAREA" || (this.queue.length < 1 && !this.triggers.includes(key)); - } isModifierKeyDown(event) { |