summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Vomacka <pvomacka@redhat.com>2016-06-24 12:07:03 +0200
committerPetr Vobornik <pvoborni@redhat.com>2016-06-30 14:22:51 +0200
commite65ce4fedc8e8e4f16c8d0c56f7618a84e8e7f85 (patch)
treea0fa05bc0bcf23b4bde949c41f8e7ddfb08af4cd
parenta3c7f845e019f79c2cefde0526790dec4f118b56 (diff)
downloadfreeipa-e65ce4fedc8e8e4f16c8d0c56f7618a84e8e7f85.tar.gz
freeipa-e65ce4fedc8e8e4f16c8d0c56f7618a84e8e7f85.tar.xz
freeipa-e65ce4fedc8e8e4f16c8d0c56f7618a84e8e7f85.zip
Add support to change button css class on confirm dialog
Part of: https://fedorahosted.org/freeipa/ticket/5588 Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
-rw-r--r--install/ui/src/freeipa/dialog.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/install/ui/src/freeipa/dialog.js b/install/ui/src/freeipa/dialog.js
index 1a0c9d22c..8552e767d 100644
--- a/install/ui/src/freeipa/dialog.js
+++ b/install/ui/src/freeipa/dialog.js
@@ -185,6 +185,8 @@ IPA.dialog_button = function(spec) {
that.visible = spec.visible !== undefined ? spec.visible : true;
/** @property {boolean} enabled=true Button is enabled */
that.enabled = spec.enabled !== undefined ? spec.enabled : true;
+ /** @property {String} button's css classes */
+ that.button_class = spec.button_class || 'btn btn-default';
/** @property {jQuery} element Button element */
that.element = null;
@@ -495,6 +497,7 @@ IPA.dialog = function(spec) {
var ui_button = IPA.button({
name: button.name,
label: button.label,
+ button_class: button.button_class,
disabled: !button.enabled,
click: button.click
});
@@ -1360,6 +1363,12 @@ IPA.confirm_dialog = function(spec) {
/** @property {Function} cancel_label Cancel button label */
that.cancel_label = text.get(spec.cancel_label || '@i18n:buttons.cancel');
+ /** @property {String} on_ok css class */
+ that.ok_button_class = spec.ok_button_class || 'btn btn-default';
+
+ /** @property {String} on_cancel css class */
+ that.cancel_button_class = spec.cancel_button_class || 'btn btn-default';
+
/**
* Dialog is confirmed
* @protected
@@ -1417,6 +1426,7 @@ IPA.confirm_dialog = function(spec) {
that.create_button({
name: 'ok',
label: that.ok_label,
+ button_class: that.ok_button_class,
click: function() {
that.on_confirm();
}
@@ -1425,6 +1435,7 @@ IPA.confirm_dialog = function(spec) {
that.create_button({
name: 'cancel',
label: that.cancel_label,
+ button_class: that.cancel_button_class,
click: function() {
that.confirmed = false;
that.close();