mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-18 04:55:44 +00:00
Adds ability to display "success" messages inside a persistant modal dialog
This commit is contained in:
@ -942,9 +942,22 @@ function handleFormSuccess(response, options) {
|
||||
cache = false;
|
||||
}
|
||||
|
||||
var msg_target = null;
|
||||
|
||||
if (options.modal && options.reloadFormAfterSuccess) {
|
||||
// If the modal is persistant, the target for any messages should be the modal!
|
||||
msg_target = $(options.modal).find('#pre-form-content');
|
||||
}
|
||||
|
||||
// Display any messages
|
||||
if (response && (response.success || options.successMessage)) {
|
||||
showAlertOrCache(response.success || options.successMessage, cache, {style: 'success'});
|
||||
showAlertOrCache(
|
||||
response.success || options.successMessage,
|
||||
cache,
|
||||
{
|
||||
style: 'success',
|
||||
target: msg_target,
|
||||
});
|
||||
}
|
||||
|
||||
if (response && response.info) {
|
||||
|
Reference in New Issue
Block a user