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

Inline deletion for BOM items

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

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';