From 05b194388630dad86c5907c187a5c483d7cb0c0b Mon Sep 17 00:00:00 2001 From: eeintech Date: Fri, 18 Feb 2022 12:25:50 -0500 Subject: [PATCH] Set default error message visibility in modal options --- InvenTree/templates/js/translated/modals.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/InvenTree/templates/js/translated/modals.js b/InvenTree/templates/js/translated/modals.js index 539ce61912..f114f6f419 100644 --- a/InvenTree/templates/js/translated/modals.js +++ b/InvenTree/templates/js/translated/modals.js @@ -893,6 +893,9 @@ function handleModalForm(url, options) { // Re-enable the modal modalEnable(modal, true); if ('form_valid' in response) { + // Get visibility option of error message + var hideErrorMessage = (options.hideErrorMessage === undefined) ? true : options.hideErrorMessage; + // Form data was validated correctly if (response.form_valid) { $(modal).modal('hide'); @@ -901,7 +904,7 @@ function handleModalForm(url, options) { // Form was returned, invalid! // Disable error message with option or response - if (!options.hideErrorMessage && !response.hideErrorMessage) { + if (!hideErrorMessage && !response.hideErrorMessage) { var warningDiv = $(modal).find('#form-validation-warning'); warningDiv.css('display', 'block'); }