diff --git a/src/opnsense/www/js/opnsense_ui.js b/src/opnsense/www/js/opnsense_ui.js index 945f49031..0038c171b 100644 --- a/src/opnsense/www/js/opnsense_ui.js +++ b/src/opnsense/www/js/opnsense_ui.js @@ -271,15 +271,15 @@ function initFormAdvancedUI() { } /** - * standard remove items dialog, wrapper around BootstrapDialog + * standard dialog when confirmation is required, wrapper around BootstrapDialog */ -function stdDialogRemoveItem(message, callback) { +function stdDialogConfirmation(title, message, accept, decline, callback) { BootstrapDialog.confirm({ - title: 'Remove', + title: title, message: message, type:BootstrapDialog.TYPE_DANGER, - btnCancelLabel: 'Cancel', - btnOKLabel: 'Yes', + btnCancelLabel: decline, + btnOKLabel: accept, btnOKClass: 'btn-primary', callback: function(result) { if(result) { @@ -288,3 +288,10 @@ function stdDialogRemoveItem(message, callback) { } }); } + +/** + * wrapper for backwards compatibility + */ +function stdDialogRemoveItem(message, callback) { + stdDialogConfirmation('Remove', message, 'Yes', 'Cancel', callback) +}