2
0
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:
Oliver
2022-03-01 00:05:30 +11:00
parent 9f5618a51f
commit 7170e16ae7
2 changed files with 17 additions and 3 deletions

View File

@ -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) {