summaryrefslogtreecommitdiffstats
path: root/client/lib/inlinedform.js
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2018-06-26 02:37:23 +0300
committerLauri Ojansivu <x@xet7.org>2018-06-26 02:37:23 +0300
commitb0444ae338b96081a066ed55a7459793720656e1 (patch)
tree8a554ec59832401be8fe87abce7bbb2af3d5e18f /client/lib/inlinedform.js
parent615f66c820c23739cc9a064b83524b181b3baccf (diff)
parent43dde4a10fc7980089f9344a7be04b8fe673cf28 (diff)
downloadwekan-b0444ae338b96081a066ed55a7459793720656e1.tar.gz
wekan-b0444ae338b96081a066ed55a7459793720656e1.tar.bz2
wekan-b0444ae338b96081a066ed55a7459793720656e1.zip
Merge branch 'devel'
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);