diff --git a/install/ui/src/freeipa/aci.js b/install/ui/src/freeipa/aci.js index 0615184c0..e26ecd27d 100644 --- a/install/ui/src/freeipa/aci.js +++ b/install/ui/src/freeipa/aci.js @@ -756,7 +756,7 @@ aci.permission_target_widget = function(spec) { that.type_select = IPA.select_widget({ entity: that.entity, name: 'type', - hidden: true, + visible: false, options: types }); that.widgets.add_widget(that.type_select); @@ -764,21 +764,21 @@ aci.permission_target_widget = function(spec) { that.ipapermlocation_text = IPA.text_widget({ entity: that.entity, name: 'ipapermlocation', - hidden: true + visible: false }); that.widgets.add_widget(that.ipapermlocation_text); that.extratargetfilter_text = IPA.multivalued_widget({ entity: that.entity, name: 'extratargetfilter', - hidden: true + visible: false }); that.widgets.add_widget(that.extratargetfilter_text); that.ipapermtarget_text = IPA.text_widget({ entity: that.entity, name: 'ipapermtarget', - hidden: true + visible: false }); that.widgets.add_widget(that.ipapermtarget_text); @@ -799,14 +799,14 @@ aci.permission_target_widget = function(spec) { entity: that.entity, name: 'attrs', object_type: types[0].name, - hidden: true + visible: false }); that.widgets.add_widget(that.attribute_table); that.attribute_multivalued = IPA.multivalued_widget({ entity: that.entity, name: 'attrs_multi', - hidden: true + visible: false }); that.widgets.add_widget(that.attribute_multivalued); }; @@ -941,7 +941,7 @@ aci.permission_target_policy = function (spec) { var enabled = !(managed_f && that.managed) && visible && !that.system; field.set_enabled(enabled); field.set_required(visible && target_info.required); - widget.hidden = !visible; + widget.set_visible(visible); }; that.target_mapping = { diff --git a/install/ui/src/freeipa/widget.js b/install/ui/src/freeipa/widget.js index 9b04acc91..ecac43645 100644 --- a/install/ui/src/freeipa/widget.js +++ b/install/ui/src/freeipa/widget.js @@ -135,6 +135,12 @@ IPA.widget = function(spec) { */ that.show_errors = spec.show_errors === undefined ? true : spec.show_errors; + /** + * Facet should be visible + * @property {boolean} + */ + that.visible = spec.visible === undefined ? true : spec.visible; + /** * Create HTML representation of a widget. * @method @@ -169,18 +175,27 @@ IPA.widget = function(spec) { * @param {boolean} value - True - visible; False - hidden */ that.set_visible = function(visible) { - var changed = visible !== that.container.is(':visible'); + var changed = visible !== that.visible; + that.visible = visible; if (visible) { - that.container.show(); + that.show(); } else { - that.container.hide(); + that.hide(); } if (changed) { that.emit('visible-change', { source: that, visible: visible }); } }; + that.hide = function() { + that.container.hide(); + }; + + that.show = function() { + that.container.show(); + }; + /** * Utility method. Build widget based on spec with this widget's context. * @param {boolean} spec - Widget specification object @@ -273,11 +288,7 @@ IPA.input_widget = function(spec) { */ that.read_only = spec.read_only; - /** - * Mark the widget to be hidden (form or dialog may not display it). - * @property {boolean} - */ - that.hidden = spec.hidden; + //events //each widget can contain several events @@ -4213,7 +4224,7 @@ IPA.table_layout = function(spec) { var tr = $('