From 1903ac12cd17a2d7dc3a73d22d1914ef30ebec88 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 16 May 2022 22:43:29 +1000 Subject: [PATCH] Allow customization of button class in modal forms --- InvenTree/templates/js/translated/forms.js | 1 + InvenTree/templates/js/translated/modals.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/InvenTree/templates/js/translated/forms.js b/InvenTree/templates/js/translated/forms.js index 642523a60b..d45a2de78c 100644 --- a/InvenTree/templates/js/translated/forms.js +++ b/InvenTree/templates/js/translated/forms.js @@ -288,6 +288,7 @@ function constructDeleteForm(fields, options) { * - method: The HTTP method e.g. 'PUT', 'POST', 'DELETE' (default='PATCH') * - title: The form title * - submitText: Text for the "submit" button + * - submitClass: CSS class for the "submit" button (default = ') * - closeText: Text for the "close" button * - fields: list of fields to display, with the following options * - filters: API query filters diff --git a/InvenTree/templates/js/translated/modals.js b/InvenTree/templates/js/translated/modals.js index 85f503682e..464006ae12 100644 --- a/InvenTree/templates/js/translated/modals.js +++ b/InvenTree/templates/js/translated/modals.js @@ -42,6 +42,8 @@ function createNewModal(options={}) { } }); + var submitClass = options.submitClass || 'primary'; + var html = `