2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-03 20:20:58 +00:00

BuildAttachmentDelete form

This commit is contained in:
Oliver
2021-06-30 12:48:14 +10:00
parent 653e3cd135
commit 4d8e88c779
4 changed files with 23 additions and 21 deletions

View File

@ -438,13 +438,25 @@ function constructFormBody(fields, options) {
// The "submit" button will be disabled unless "confirm" is checked
function insertConfirmButton(options) {
var message = options.confirmMessage || '{% trans "Confirm" %}';
var confirm = `
<span style='float: left;'>
Confirm
<input name='confirm' type='checkbox'>
${message}
<input id='modal-confirm' name='confirm' type='checkbox'>
</span>`;
$(options.modal).find('#modal-footer-buttons').append(confirm);
// Disable the 'submit' button
$(options.modal).find('#modal-form-submit').prop('disabled', true);
// Trigger event
$(options.modal).find('#modal-confirm').change(function() {
var enabled = this.checked;
$(options.modal).find('#modal-form-submit').prop('disabled', !enabled);
});
}