From 49b7f4c06e17b91372decf33b812a7fbbfa01ff4 Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Mon, 15 Apr 2013 19:23:15 +0200 Subject: Replace IPA.widget_factories and IPA_field_factories with registry https://fedorahosted.org/freeipa/ticket/3235 --- install/ui/src/freeipa/association.js | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'install/ui/src/freeipa/association.js') diff --git a/install/ui/src/freeipa/association.js b/install/ui/src/freeipa/association.js index e378ad44..f23568c4 100644 --- a/install/ui/src/freeipa/association.js +++ b/install/ui/src/freeipa/association.js @@ -22,8 +22,16 @@ /* CURRENTLY ALSO REQUIRES search.js, because it reuses it's code to create * the AssociationList elements; IT NEEDS IT'S OWN CODE! */ -define(['./ipa', './jquery', './navigation', './text', './search', './dialog'], - function(IPA, $, navigation, text) { +define([ + './ipa', + './jquery', + './navigation', + './phases', + './reg', + './text', + './search', + './dialog'], + function(IPA, $, navigation, phases, reg, text) { IPA.associator = function (spec) { @@ -740,10 +748,6 @@ IPA.association_table_field = function (spec) { return that; }; -IPA.widget_factories['association_table'] = IPA.association_table_widget; -IPA.field_factories['association_table'] = IPA.association_table_field; - - IPA.association_facet = function (spec, no_init) { spec = spec || {}; @@ -1381,5 +1385,13 @@ IPA.attr_read_only_evaluator = function(spec) { return that; }; +phases.on('registration', function() { + var w = reg.widget; + var f = reg.field; + + w.register('association_table', IPA.association_table_widget); + f.register('association_table', IPA.association_table_field); +}); + return {}; }); -- cgit