mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Set default error message visibility in modal options
This commit is contained in:
parent
0f7b6e77ea
commit
05b1943886
@ -893,6 +893,9 @@ function handleModalForm(url, options) {
|
|||||||
// Re-enable the modal
|
// Re-enable the modal
|
||||||
modalEnable(modal, true);
|
modalEnable(modal, true);
|
||||||
if ('form_valid' in response) {
|
if ('form_valid' in response) {
|
||||||
|
// Get visibility option of error message
|
||||||
|
var hideErrorMessage = (options.hideErrorMessage === undefined) ? true : options.hideErrorMessage;
|
||||||
|
|
||||||
// Form data was validated correctly
|
// Form data was validated correctly
|
||||||
if (response.form_valid) {
|
if (response.form_valid) {
|
||||||
$(modal).modal('hide');
|
$(modal).modal('hide');
|
||||||
@ -901,7 +904,7 @@ function handleModalForm(url, options) {
|
|||||||
// Form was returned, invalid!
|
// Form was returned, invalid!
|
||||||
|
|
||||||
// Disable error message with option or response
|
// Disable error message with option or response
|
||||||
if (!options.hideErrorMessage && !response.hideErrorMessage) {
|
if (!hideErrorMessage && !response.hideErrorMessage) {
|
||||||
var warningDiv = $(modal).find('#form-validation-warning');
|
var warningDiv = $(modal).find('#form-validation-warning');
|
||||||
warningDiv.css('display', 'block');
|
warningDiv.css('display', 'block');
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user