mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +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:
parent
fdf214626c
commit
ee0c664d28
@ -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() {
|
$(modal).on('click', '#modal-form-delete', function() {
|
||||||
|
|
||||||
var form = $(modal).find('#delete-form');
|
var form = $(modal).find('#delete-form');
|
||||||
@ -169,6 +172,9 @@ function handleModalForm(modal, url, options) {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Un-bind any attached click listeners
|
||||||
|
$(modal).off('click', '#modal-form-submit');
|
||||||
|
|
||||||
$(modal).on('click', '#modal-form-submit', function() {
|
$(modal).on('click', '#modal-form-submit', function() {
|
||||||
$(modal).find('.js-modal-form').ajaxSubmit({
|
$(modal).find('.js-modal-form').ajaxSubmit({
|
||||||
url: url,
|
url: url,
|
||||||
|
Loading…
Reference in New Issue
Block a user