summaryrefslogtreecommitdiffstats
path: root/install/ui/src/freeipa/facet.js
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2013-10-04 19:00:21 +0200
committerPetr Viktorin <pviktori@redhat.com>2014-03-12 17:29:28 +0100
commit0700b13807fd5e9a8503ba5b88d2e1aec417aef6 (patch)
tree6995655edad278b5bc40251a3c003b08bdc2bef0 /install/ui/src/freeipa/facet.js
parent05a9c6de2b94459cd5e54addf855bbc76db906ab (diff)
downloadfreeipa-0700b13807fd5e9a8503ba5b88d2e1aec417aef6.tar.gz
freeipa-0700b13807fd5e9a8503ba5b88d2e1aec417aef6.tar.xz
freeipa-0700b13807fd5e9a8503ba5b88d2e1aec417aef6.zip
Fix handling of action visibility change in action panel
Reviewed-By: Adam Misnyovszki <amisnyov@redhat.com>
Diffstat (limited to 'install/ui/src/freeipa/facet.js')
-rw-r--r--install/ui/src/freeipa/facet.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/install/ui/src/freeipa/facet.js b/install/ui/src/freeipa/facet.js
index 5127489d2..6afc79d61 100644
--- a/install/ui/src/freeipa/facet.js
+++ b/install/ui/src/freeipa/facet.js
@@ -3236,6 +3236,7 @@ exp.action_list_widget = IPA.action_list_widget = function(spec) {
for (i=0; i< actions.length; i++) {
action = actions[i];
+ if (!action.visible) continue;
options.push({
label: action.label,
value: action.name
@@ -3316,6 +3317,23 @@ exp.action_list_widget = IPA.action_list_widget = function(spec) {
};
/**
+ * Handle action's `visible_changed` event.
+ * @protected
+ * @param {boolean} visible
+ */
+ that.action_visible_changed = function(visible) {
+ var action = this;
+ var selected_action = that.get_selected();
+
+ that.init_options();
+ that.recreate_options();
+
+ if (!action.visible && action === selected_action) {
+ that.select_first_enabled();
+ }
+ };
+
+ /**
* Get selected action
* @return {facet.action}
*/