diff options
author | Petr Vobornik <pvoborni@redhat.com> | 2013-04-16 17:06:04 +0200 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2013-05-06 16:22:27 +0200 |
commit | 5239d3750e9a82028e79ffe95b9280fb606fb47b (patch) | |
tree | 2cc4cfa295f50e2bf3842250a85e4b526c315764 /install/ui/src/freeipa | |
parent | 799bb24931f97be849eea48c6497adcd239e287c (diff) | |
download | freeipa-5239d3750e9a82028e79ffe95b9280fb606fb47b.tar.gz freeipa-5239d3750e9a82028e79ffe95b9280fb606fb47b.tar.xz freeipa-5239d3750e9a82028e79ffe95b9280fb606fb47b.zip |
Change widget.build_child interface to the builder's
https://fedorahosted.org/freeipa/ticket/3235
Diffstat (limited to 'install/ui/src/freeipa')
-rw-r--r-- | install/ui/src/freeipa/widget.js | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/install/ui/src/freeipa/widget.js b/install/ui/src/freeipa/widget.js index df497d6e9..6cfa53d1c 100644 --- a/install/ui/src/freeipa/widget.js +++ b/install/ui/src/freeipa/widget.js @@ -69,21 +69,14 @@ IPA.widget = function(spec) { } }; - that.build_child = function(spec, factory) { + that.build_child = function(spec, context, overrides) { - if (typeof spec === 'function') { - spec = { - $factory: spec - }; - } - - $.extend(spec, { - parent: that, + var def_c = { entity: that.entity, facet: that.facet - }); - - var child = IPA.build(spec,{}, factory); + }; + context = lang.mixin(def_c, context); + var child = builder.build('widget', spec, context, overrides); return child; }; @@ -3162,7 +3155,8 @@ IPA.details_table_section = function(spec) { var that = IPA.details_section(spec); that.layout = IPA.build(spec.layout || IPA.table_layout); - that.action_panel = that.build_child(spec.action_panel); + that.action_panel = that.build_child(spec.action_panel, {}, + { $factory: IPA.action_panel }); that.rows = $.ordered_map(); @@ -3965,6 +3959,7 @@ exp.register = function() { var w = reg.widget; var f = reg.formatter; + w.register('action_panel', IPA.action_panel); w.register('attribute_table', IPA.attribute_table_widget); w.register('button', IPA.button_widget); w.register('checkbox', IPA.checkbox_widget); |