diff options
| author | Hunternif | 2019-04-16 09:00:19 +0700 |
|---|---|---|
| committer | Hunternif | 2019-04-16 09:00:19 +0700 |
| commit | a37ce857f7a489ce2105e476999773946c744d25 (patch) | |
| tree | aafdeddb6214419bd7865ffe245f601830c8b96d /client/js/util | |
| parent | 14b85fc3064feb7c5e5996c2025c785b3a7a1551 (diff) | |
Ctrl+s works even when focusing tag input
Diffstat (limited to 'client/js/util')
| -rw-r--r-- | client/js/util/keyboard.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/client/js/util/keyboard.js b/client/js/util/keyboard.js index c3b9543..3e3158a 100644 --- a/client/js/util/keyboard.js +++ b/client/js/util/keyboard.js @@ -20,6 +20,13 @@ function bind(hotkey, func) { } return false; } +function bindElement(element, hotkey, func) { + if (settings.get().keyboardShortcuts) { + mousetrap(element).bind(hotkey, func); + return true; + } + return false; +} function unbind(hotkey) { mousetrap.unbind(hotkey); @@ -27,6 +34,7 @@ function unbind(hotkey) { module.exports = { bind: bind, + bindElement: bindElement, unbind: unbind, pause: () => { paused = true; }, unpause: () => { paused = false; }, |