diff --git a/InvenTree/templates/js/translated/modals.js b/InvenTree/templates/js/translated/modals.js index a0492bac44..f2639f580b 100644 --- a/InvenTree/templates/js/translated/modals.js +++ b/InvenTree/templates/js/translated/modals.js @@ -45,6 +45,18 @@ function createNewModal(options={}) { var submitClass = options.submitClass || 'primary'; + var buttons = ''; + + // Add in a "close" button + if (!options.hideCloseButton) { + buttons += ``; + } + + // Add in a "submit" button + if (!options.hideSubmitButton) { + buttons += ``; + } + var html = ` @@ -102,11 +113,7 @@ function createNewModal(options={}) { // Steal keyboard focus $(modal_name).focus(); - if (options.hideCloseButton) { - $(modal_name).find('#modal-form-close').hide(); - } - - if (options.preventSubmit || options.hideSubmitButton) { + if (options.preventSubmit) { $(modal_name).find('#modal-form-submit').hide(); } diff --git a/InvenTree/templates/js/translated/order.js b/InvenTree/templates/js/translated/order.js index a408e4643a..9cb7c5dd77 100644 --- a/InvenTree/templates/js/translated/order.js +++ b/InvenTree/templates/js/translated/order.js @@ -1213,7 +1213,7 @@ function orderParts(parts_list, options={}) { constructFormBody({}, { preFormContent: html, title: '{% trans "Order Parts" %}', - preventSubmit: true, + hideSubmitButton: true, closeText: '{% trans "Close" %}', afterRender: function(fields, opts) { parts.forEach(function(part) {