Inline deletion for BOM items

This commit is contained in:
Oliver committed 2018-04-27 00:54:01 +10:00
1 parent 507e3de05b
commit 5162c1d11f
10 files changed
+134 -109

No files matched your search

+13 -3
View File
@@ -8,7 +8,8 @@ function attachSelect(modal) {
});
}
function launchDeleteForm(modal, url, options) {
function launchDeleteForm(modal, url, options = {}) {
$(modal).on('shown.bs.modal', function() {
$(modal + ' .modal-form-content').scrollTop(0);
});
@@ -62,7 +63,7 @@ function launchDeleteForm(modal, url, options) {
});
}
function launchModalForm(modal, url, options) {
function launchModalForm(modal, url, options = {}) {
$(modal).on('shown.bs.modal', function () {
$(modal + ' .modal-form-content').scrollTop(0);
@@ -119,8 +120,17 @@ function launchModalForm(modal, url, options) {
dataType: 'json',
success: function (response) {
if (response.form_valid) {
alert("Success!");
$(modal).modal('hide');
if (options.redirect) {
window.location.href = options.redirect;
}
if (options.success) {
options.success();
}
}
else if (response.html_form) {
var target = modal + ' .modal-form-content';