mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-02 13:28:49 +00:00
Allow customization of button class in modal forms
This commit is contained in:
parent
8052d78311
commit
1903ac12cd
@ -288,6 +288,7 @@ function constructDeleteForm(fields, options) {
|
|||||||
* - method: The HTTP method e.g. 'PUT', 'POST', 'DELETE' (default='PATCH')
|
* - method: The HTTP method e.g. 'PUT', 'POST', 'DELETE' (default='PATCH')
|
||||||
* - title: The form title
|
* - title: The form title
|
||||||
* - submitText: Text for the "submit" button
|
* - submitText: Text for the "submit" button
|
||||||
|
* - submitClass: CSS class for the "submit" button (default = ')
|
||||||
* - closeText: Text for the "close" button
|
* - closeText: Text for the "close" button
|
||||||
* - fields: list of fields to display, with the following options
|
* - fields: list of fields to display, with the following options
|
||||||
* - filters: API query filters
|
* - filters: API query filters
|
||||||
|
@ -42,6 +42,8 @@ function createNewModal(options={}) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var submitClass = options.submitClass || 'primary';
|
||||||
|
|
||||||
var html = `
|
var html = `
|
||||||
<div class='modal fade modal-fixed-footer modal-primary inventree-modal' role='dialog' id='modal-form-${id}' tabindex='-1'>
|
<div class='modal fade modal-fixed-footer modal-primary inventree-modal' role='dialog' id='modal-form-${id}' tabindex='-1'>
|
||||||
<div class='modal-dialog'>
|
<div class='modal-dialog'>
|
||||||
@ -74,7 +76,7 @@ function createNewModal(options={}) {
|
|||||||
<span class='flex-item' style='flex-grow: 1;'></span>
|
<span class='flex-item' style='flex-grow: 1;'></span>
|
||||||
<h4><span id='modal-progress-spinner' class='fas fa-circle-notch fa-spin' style='display: none;'></span></h4>
|
<h4><span id='modal-progress-spinner' class='fas fa-circle-notch fa-spin' style='display: none;'></span></h4>
|
||||||
<button type='button' class='btn btn-secondary' id='modal-form-close' data-bs-dismiss='modal'>{% trans "Cancel" %}</button>
|
<button type='button' class='btn btn-secondary' id='modal-form-close' data-bs-dismiss='modal'>{% trans "Cancel" %}</button>
|
||||||
<button type='button' class='btn btn-primary' id='modal-form-submit'>{% trans "Submit" %}</button>
|
<button type='button' class='btn btn-${submitClass}' id='modal-form-submit'>{% trans "Submit" %}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user