diff options
author | Frederic Guillot <fred@kanboard.net> | 2017-01-28 16:44:10 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2017-01-28 16:45:58 -0500 |
commit | 58fac9b1bec7874523ab1894f5976f16e2ea2ce4 (patch) | |
tree | b1e6684eebd4f2e9b08086de306db9ef31ff601f /assets/js/components | |
parent | 522ceae6bb62cb95409376be56741c8c6f5e75ca (diff) |
Fix form submit when using keyboard shortcuts
Diffstat (limited to 'assets/js/components')
-rw-r--r-- | assets/js/components/keyboard-shortcuts.js | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/assets/js/components/keyboard-shortcuts.js b/assets/js/components/keyboard-shortcuts.js index 037d5c5f..cffcd790 100644 --- a/assets/js/components/keyboard-shortcuts.js +++ b/assets/js/components/keyboard-shortcuts.js @@ -10,15 +10,17 @@ KB.keyboardShortcuts = function () { } function submitForm() { - var forms = $("form"); - - if (forms.length == 1) { - forms.submit(); - } else if (forms.length > 1) { - if (document.activeElement.tagName === 'INPUT' || document.activeElement.tagName === 'TEXTAREA') { - $(document.activeElement).parents("form").submit(); - } else if (KB.modal.isOpen()) { - KB.modal.getForm().submit(); + if (KB.modal.isOpen()) { + KB.modal.submitForm(); + } else { + var forms = $("form"); + + if (forms.length == 1) { + forms.submit(); + } else if (forms.length > 1) { + if (document.activeElement.tagName === 'INPUT' || document.activeElement.tagName === 'TEXTAREA') { + $(document.activeElement).parents("form").submit(); + } } } } |