Fix form submit when using keyboard shortcuts
This commit is contained in:
6
assets/js/app.min.js
vendored
6
assets/js/app.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -10,15 +10,17 @@ KB.keyboardShortcuts = function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function submitForm() {
|
function submitForm() {
|
||||||
var forms = $("form");
|
if (KB.modal.isOpen()) {
|
||||||
|
KB.modal.submitForm();
|
||||||
|
} else {
|
||||||
|
var forms = $("form");
|
||||||
|
|
||||||
if (forms.length == 1) {
|
if (forms.length == 1) {
|
||||||
forms.submit();
|
forms.submit();
|
||||||
} else if (forms.length > 1) {
|
} else if (forms.length > 1) {
|
||||||
if (document.activeElement.tagName === 'INPUT' || document.activeElement.tagName === 'TEXTAREA') {
|
if (document.activeElement.tagName === 'INPUT' || document.activeElement.tagName === 'TEXTAREA') {
|
||||||
$(document.activeElement).parents("form").submit();
|
$(document.activeElement).parents("form").submit();
|
||||||
} else if (KB.modal.isOpen()) {
|
}
|
||||||
KB.modal.getForm().submit();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -167,6 +167,7 @@
|
|||||||
replace(response);
|
replace(response);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getForm: getForm
|
getForm: getForm,
|
||||||
|
submitForm: submitForm
|
||||||
};
|
};
|
||||||
}());
|
}());
|
||||||
|
|||||||
Reference in New Issue
Block a user