From 00e921f505f48357504c9c79bb48cefd787c2123 Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 2 Jul 2021 11:13:24 +1000 Subject: [PATCH] More work on dynamic modal template --- InvenTree/templates/js/forms.js | 4 +--- InvenTree/templates/js/modals.js | 22 ++++++++++++++++------ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/InvenTree/templates/js/forms.js b/InvenTree/templates/js/forms.js index 3f0ae6fffb..cb505c2a11 100644 --- a/InvenTree/templates/js/forms.js +++ b/InvenTree/templates/js/forms.js @@ -304,8 +304,6 @@ function constructFormBody(fields, options) { var html = ''; - html += `
`; - // Client must provide set of fields to be displayed, // otherwise *all* fields will be displayed var displayed_fields = options.fields || fields; @@ -684,7 +682,7 @@ function clearFormErrors(options) { // Remove the "has error" class $(options.modal).find('.has-error').removeClass('has-error'); - // Clear the 'non field errors' + // Hide the 'non field errors' $(options.modal).find('#non-field-errors').html(''); } diff --git a/InvenTree/templates/js/modals.js b/InvenTree/templates/js/modals.js index 180f3bed95..319158eaa0 100644 --- a/InvenTree/templates/js/modals.js +++ b/InvenTree/templates/js/modals.js @@ -19,18 +19,28 @@ function createNewModal(options={}) { - + + +