diff options
-rw-r--r-- | client/lib/inlinedform.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/client/lib/inlinedform.js b/client/lib/inlinedform.js index 56768a13..272d79f7 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); |