mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
add custom buttons with response
This commit is contained in:
parent
3d17388b48
commit
96c29847e1
@ -797,6 +797,14 @@ function handleModalForm(url, options) {
|
||||
if (response.title) {
|
||||
modalSetTitle(modal, response.title);
|
||||
}
|
||||
|
||||
// Clean custom action buttons
|
||||
$(modal).find('#modal-footer-buttons').html('');
|
||||
|
||||
// Add custom action buttons with response
|
||||
if (response.buttons) {
|
||||
attachButtons(modal, response.buttons);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$(modal).modal('hide');
|
||||
@ -902,6 +910,11 @@ function launchModalForm(url, options = {}) {
|
||||
attachButtons(modal, options.buttons);
|
||||
}
|
||||
|
||||
// Add custom buttons from response
|
||||
if (response.buttons) {
|
||||
attachButtons(modal, response.buttons);
|
||||
}
|
||||
|
||||
} else {
|
||||
$(modal).modal('hide');
|
||||
showAlertDialog('{% trans "Invalid server response" %}', '{% trans "JSON response missing form data" %}');
|
||||
|
Loading…
Reference in New Issue
Block a user