Modal for edit and delete part category

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

No files matched your search

+13 -6
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';