summaryrefslogtreecommitdiffstats
path: root/install/ui/src/freeipa/facet.js
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2014-05-13 13:00:16 +0200
committerPetr Vobornik <pvoborni@redhat.com>2014-06-10 10:23:29 +0200
commit408457ce53c553c27f25a682f3f5118ae2e1ab30 (patch)
treed87f62b6e061397b177aeb362cf406c3aa11e9b2 /install/ui/src/freeipa/facet.js
parent40a25ecf371ebfcbb0801e1f99e3a2853439f44b (diff)
downloadfreeipa-408457ce53c553c27f25a682f3f5118ae2e1ab30.tar.gz
freeipa-408457ce53c553c27f25a682f3f5118ae2e1ab30.tar.xz
freeipa-408457ce53c553c27f25a682f3f5118ae2e1ab30.zip
webui: change control buttons to normal buttons
Now buttons have normal button appearance instead of link button. Partially fixes: https://fedorahosted.org/freeipa/ticket/4258 since the disabling is done through button's disabled attribute. Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
Diffstat (limited to 'install/ui/src/freeipa/facet.js')
-rw-r--r--install/ui/src/freeipa/facet.js96
1 files changed, 2 insertions, 94 deletions
diff --git a/install/ui/src/freeipa/facet.js b/install/ui/src/freeipa/facet.js
index d8ac90a0a..f84397201 100644
--- a/install/ui/src/freeipa/facet.js
+++ b/install/ui/src/freeipa/facet.js
@@ -2873,40 +2873,7 @@ exp.action_button_widget = IPA.action_button_widget = function(spec) {
spec = spec || {};
- var that = IPA.widget(spec);
-
- /**
- * Name
- * @property {string}
- */
- that.name = spec.name;
-
- /**
- * Label
- * @property {string}
- */
- that.label = text.get(spec.label);
-
- /**
- * Tooltip
- * @property {string}
- */
- that.tooltip = text.get(spec.tooltip);
-
- /**
- * Button href
- *
- * - purely visual thing, the click itself is handled internally.
- * @property {string}
- */
- that.href = spec.href || that.name;
-
- /**
- * Icon name
- * @property {string}
- */
- that.icon = spec.icon;
-
+ var that = IPA.button_widget(spec);
/**
* Name of action this button should execute
* @property {string}
@@ -2914,20 +2881,6 @@ exp.action_button_widget = IPA.action_button_widget = function(spec) {
that.action_name = spec.action || that.name;
/**
- * Enabled
- * @property {boolean}
- * @readonly
- */
- that.enabled = spec.enabled !== undefined ? spec.enabled : true;
-
- /**
- * Visible
- * @property {boolean}
- * @readonly
- */
- that.visible = spec.visible !== undefined ? spec.visible : true;
-
- /**
* Subject to removal
* @deprecated
*/
@@ -2959,19 +2912,7 @@ exp.action_button_widget = IPA.action_button_widget = function(spec) {
*/
that.create = function(container) {
- that.widget_create(container);
-
- that.button_element = IPA.action_button({
- name: that.name,
- href: that.href,
- label: that.label,
- icon: that.icon,
- click: function() {
- that.on_click();
- return false;
- }
- }).appendTo(container);
-
+ that.button_widget_create(container);
that.set_enabled(that.action.enabled);
that.set_visible(that.action.visible);
};
@@ -2988,39 +2929,6 @@ exp.action_button_widget = IPA.action_button_widget = function(spec) {
that.action.execute(that.facet);
};
- /**
- * Enabled setter
- * @param {boolean} enabled
- */
- that.set_enabled = function(enabled) {
- that.widget_set_enabled(enabled);
-
- if (that.button_element) {
- if (enabled) {
- that.button_element.removeClass('action-button-disabled');
- } else {
- that.button_element.addClass('action-button-disabled');
- }
- }
- };
-
- /**
- * Visible setter
- * @param {boolean} visible
- */
- that.set_visible = function(visible) {
-
- that.visible = visible;
-
- if (that.button_element) {
- if (visible) {
- that.button_element.show();
- } else {
- that.button_element.hide();
- }
- }
- };
-
return that;
};