From 45b70425fc41ffd3b79f60bc51d45ddded4bfcd8 Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Thu, 11 Apr 2013 12:32:39 +0200 Subject: Replace old builder by new implementation https://fedorahosted.org/freeipa/ticket/3235 --- install/ui/src/freeipa/facet.js | 72 ++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 44 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 df54ceab..17033f96 100644 --- a/install/ui/src/freeipa/facet.js +++ b/install/ui/src/freeipa/facet.js @@ -28,6 +28,7 @@ define([ 'dojo/on', 'dojo/Stateful', 'dojo/Evented', + './_base/Builder', './ipa', './jquery', './navigation', @@ -36,7 +37,7 @@ define([ './field', './widget' ], function(declare, lang, construct, on, Stateful, Evented, - IPA, $, navigation, text) { + Builder, IPA, $, navigation, text) { /** * Facet represents the content of currently displayed page. @@ -102,8 +103,6 @@ exp.facet_spec = {}; exp.facet = IPA.facet = function(spec, no_init) { spec = spec || {}; - spec.state = spec.state || {}; - $.extend(spec.state, { factory: IPA.state }); var that = new Evented(); @@ -119,8 +118,8 @@ exp.facet = IPA.facet = function(spec, no_init) { that.disable_breadcrumb = spec.disable_breadcrumb; that.disable_facet_tabs = spec.disable_facet_tabs; - that.action_state = IPA.build(spec.state); - that.actions = IPA.build({ actions: spec.actions }, IPA.action_holder_builder); + that.action_state = IPA.build(spec.state, {}, { factory: exp.state }); + that.actions = exp.action_holder_builder.build({ actions: spec.actions }); that.header_actions = spec.header_actions; that.header = spec.header || IPA.facet_header({ facet: that }); @@ -1716,15 +1715,6 @@ exp.action = IPA.action = function(spec) { return that; }; -exp.action_builder = IPA.action_builder = function(spec) { - - spec = spec || {}; - spec.factory = spec.factory || IPA.action; - var that = IPA.builder(spec); - return that; -}; - - exp.action_holder = IPA.action_holder = function(spec) { spec = spec || {}; @@ -1738,7 +1728,7 @@ exp.action_holder = IPA.action_holder = function(spec) { var i, action, actions; that.facet = facet; - actions = IPA.build(spec.actions, IPA.action_builder) || []; + actions = exp.action_builder.build(spec.actions); for (i=0; i