mirror of
https://github.com/inventree/InvenTree.git
synced 2026-10-06 18:31:16 +00:00
Prevent modals from firing multiple events
- e.g. if the modal has been open and closed multiple times! - Detach all previously attached events
This commit is contained in:
1 parent
fdf214626c
commit
ee0c664d28
1 file changed
+6
@@ -125,6 +125,9 @@ function launchDeleteForm(modal, url, options = {}) {
|
||||
}
|
||||
});
|
||||
|
||||
// Un-bind any attached click listeners
|
||||
$(modal).off('click', '#modal-form-delete');
|
||||
|
||||
$(modal).on('click', '#modal-form-delete', function() {
|
||||
|
||||
var form = $(modal).find('#delete-form');
|
||||
@@ -169,6 +172,9 @@ function handleModalForm(modal, url, options) {
|
||||
return false;
|
||||
});
|
||||
|
||||
// Un-bind any attached click listeners
|
||||
$(modal).off('click', '#modal-form-submit');
|
||||
|
||||
$(modal).on('click', '#modal-form-submit', function() {
|
||||
$(modal).find('.js-modal-form').ajaxSubmit({
|
||||
url: url,
|
||||
|
||||
Reference in new issue
Block a user