mirror of
https://github.com/wekan/wekan.git
synced 2025-12-29 13:48:49 +01:00
submit inline form on click outside
This commit is contained in:
parent
484d495259
commit
77ae6c17e7
1 changed files with 11 additions and 1 deletions
|
|
@ -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 formIsOpen = currentlyOpenedForm.get() && currentlyOpenedForm.get().isOpen.get();
|
||||
const isClickOutside = $(evt.target).closest(".js-inlined-form").length === 0;
|
||||
if (formIsOpen && isClickOutside) {
|
||||
$('.js-inlined-form button[type=submit]').click();
|
||||
currentlyOpenedForm.get().close();
|
||||
}
|
||||
}, true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue