From fc0926ba91f57cb5cd182f2edf50f24d4cfd7432 Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Mon, 14 Apr 2014 12:29:15 +0200 Subject: webui: remove action list widget Reviewed-By: Endi Sukma Dewata --- install/ui/src/freeipa/facet.js | 318 ---------------------------------------- 1 file changed, 318 deletions(-) (limited to 'install/ui/src/freeipa/facet.js') diff --git a/install/ui/src/freeipa/facet.js b/install/ui/src/freeipa/facet.js index 8e0e216b9..683575e8c 100644 --- a/install/ui/src/freeipa/facet.js +++ b/install/ui/src/freeipa/facet.js @@ -1011,11 +1011,6 @@ exp.facet_header = IPA.facet_header = function(spec) { */ that.facet = spec.facet; - /** - * Action list with facet's header actions - * @property {facet.action_list_widget} action_list - */ - /** * Facet title widget * @property {facet.facet_title} title_widget @@ -1035,14 +1030,6 @@ exp.facet_header = IPA.facet_header = function(spec) { facet: that.facet } }); - - var widget = { - $factory: IPA.action_list_widget, - actions: that.facet.header_actions - }; - - that.action_list = widget_builder.build_widget(widget); - that.action_list.init(that.facet); } that.facet.action_state.changed.attach(that.update_summary); @@ -1088,8 +1075,6 @@ exp.facet_header = IPA.facet_header = function(spec) { pkey_tooltip: value }; that.title_widget.update(title_info); - - that.adjust_elements(); }; that.update_breadcrumb = function(pkey) { @@ -1246,14 +1231,6 @@ exp.facet_header = IPA.facet_header = function(spec) { that.title_widget.create(container); that.title_widget.update({ title: that.facet.label }); - if (that.action_list) { - that.action_list_container = $('
', { - 'class': 'facet-action-list' - }).appendTo(container); - - that.action_list.create(that.action_list_container); - } - if (!that.facet.disable_facet_tabs) { that.facet_tabs = $('
', { 'class': 'facet-tabs' @@ -1334,8 +1311,6 @@ exp.facet_header = IPA.facet_header = function(spec) { that.title_widget.set_class(css_class); that.title_widget.set_icon_tooltip(summary.description); } - - that.adjust_elements(); }; /** @@ -1352,44 +1327,16 @@ exp.facet_header = IPA.facet_header = function(spec) { char_w = label_w / that.title_widget.title.text().length; max_pkey_w = container_w - icon_w - label_w; max_pkey_w -= 10; //some space correction to be safe - - if (that.action_list) { - al = that.action_list.container; - al_w = al.width(); - - max_pkey_w -= al_w; - } - max_pkey_l = Math.ceil(max_pkey_w / char_w); return max_pkey_l; }; - /** - * Adjust position of header widgets, mainly action list, according to - * title length. - */ - that.adjust_elements = function() { - - if (that.action_list) { - - var action_list = that.action_list.container; - var max_width = that.container.width(); - var al_width = action_list.width(); - var title_width = that.title_widget.title_container.width(); - var title_max = max_width - al_width; - - that.title_widget.set_max_width(title_max); - action_list.css('left', title_width + 'px'); - } - }; - /** * Clear displayed information */ that.clear = function() { that.load(); - if (that.action_list) that.action_list.clear(); }; return that; @@ -3137,270 +3084,6 @@ exp.eval_cond = IPA.eval_cond = function(enable_cond, disable_cond, state) { return true; }; -/** - * Action list widget to be displayed in facet header - * - * @class facet.action_list_widget - * @extends IPA.composite_widget - * @alternateClassName IPA.action_list_widget - */ -exp.action_list_widget = IPA.action_list_widget = function(spec) { - - spec = spec || {}; - - spec.widgets = spec.widgets || [ - { - $type: 'html', - css_class: 'separator' - }, - { - $type: 'select', - name: 'action', - undo: false - }, - { - $type: 'button', - name: 'apply', - label: '@i18n:actions.apply' - } - ]; - - var that = IPA.composite_widget(spec); - - /** - * Names of actions, which should be later obtained from facet - * @property {Array.} - */ - that.action_names = spec.actions || []; - - /** - * Actions - * @property {ordered_map} - */ - that.actions = $.ordered_map(); - - /** - * Initializes action list - * - * - set facet - * - get actions from facet - * - init child widgets - * - * @param {facet.facet} facet - */ - that.init = function(facet) { - - var options, actions, action, name, i; - - that.facet = facet; - - that.action_select = that.widgets.get_widget('action'); - that.apply_button = that.widgets.get_widget('apply'); - - that.action_select.value_changed.attach(that.on_action_change); - that.apply_button.click = that.on_apply; - - for (i=0; i