summaryrefslogtreecommitdiffstats
path: root/client/lib/inlinedform.js
diff options
context:
space:
mode:
authorNicu Tofan <nicu.tofan@gmail.com>2018-06-28 17:00:35 +0300
committerNicu Tofan <nicu.tofan@gmail.com>2018-06-28 17:00:35 +0300
commit3eba6ef2856946925795f9cd370583be892344dd (patch)
tree11d3bb19678153f955647fbf4b3f6d2299933d7d /client/lib/inlinedform.js
parentb7d508e8c4cf858559e144053d119ceaebfa9697 (diff)
parentad54a8a48404a84b0bf5ff7dab5348be6dda574e (diff)
downloadwekan-3eba6ef2856946925795f9cd370583be892344dd.tar.gz
wekan-3eba6ef2856946925795f9cd370583be892344dd.tar.bz2
wekan-3eba6ef2856946925795f9cd370583be892344dd.zip
Merge branch 'devel' into nested-tasks
Diffstat (limited to 'client/lib/inlinedform.js')
-rw-r--r--client/lib/inlinedform.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/client/lib/inlinedform.js b/client/lib/inlinedform.js
index 56768a13..e5e4d4ed 100644
--- a/client/lib/inlinedform.js
+++ b/client/lib/inlinedform.js
@@ -75,6 +75,16 @@ InlinedForm = BlazeComponent.extendComponent({
EscapeActions.register('inlinedForm',
() => { currentlyOpenedForm.get().close(); },
() => { return currentlyOpenedForm.get() !== null; }, {
- noClickEscapeOn: '.js-inlined-form',
+ enabledOnClick: false,
}
);
+
+// submit on click outside
+document.addEventListener('click', function(evt) {
+ const openedForm = currentlyOpenedForm.get();
+ const isClickOutside = $(evt.target).closest('.js-inlined-form').length === 0;
+ if (openedForm && isClickOutside) {
+ $('.js-inlined-form button[type=submit]').click();
+ openedForm.close();
+ }
+}, true);