2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-02 11:40:58 +00:00

Modal for edit and delete part category

This commit is contained in:
Oliver
2018-04-27 20:42:12 +10:00
parent 5162c1d11f
commit bc3dca3aba
4 changed files with 61 additions and 58 deletions

View File

@ -51,9 +51,15 @@ function launchDeleteForm(modal, url, options = {}) {
success: function (response) {
$(modal).modal('hide');
if (options.redirect) {
if (options.success) {
options.success();
}
else if (options.redirect) {
window.location.href = options.redirect;
}
else if (options.reload) {
location.reload();
}
},
error: function (xhr, ajaxOptions, thrownError) {
alert('Error deleting item:\n' + thrownError);
@ -123,14 +129,15 @@ function launchModalForm(modal, url, options = {}) {
$(modal).modal('hide');
if (options.redirect) {
window.location.href = options.redirect;
}
if (options.success) {
options.success();
}
else if (options.redirect) {
window.location.href = options.redirect;
}
else if (options.reload) {
location.reload();
}
}
else if (response.html_form) {
var target = modal + ' .modal-form-content';