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/rule.js | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'install/ui/src/freeipa/rule.js') diff --git a/install/ui/src/freeipa/rule.js b/install/ui/src/freeipa/rule.js index faa305a4b..194b443d6 100644 --- a/install/ui/src/freeipa/rule.js +++ b/install/ui/src/freeipa/rule.js @@ -18,8 +18,16 @@ * along with this program. If not, see . */ -define(['./ipa', './jquery', './details', './search', './association', - './entity'], function(IPA, $) { +define([ + './ipa', + './jquery', + './phases', + './reg', + './details', + './search', + './association', + './entity'], + function(IPA, $, phases, reg) { IPA.rule_details_widget = function(spec) { @@ -223,9 +231,6 @@ IPA.rule_association_table_field = function(spec) { return that; }; -IPA.widget_factories['rule_association_table'] = IPA.rule_association_table_widget; -IPA.field_factories['rule_association_table'] = IPA.rule_association_table_field; - IPA.rule_association_adder_dialog = function(spec) { spec = spec || {}; @@ -253,5 +258,13 @@ IPA.rule_association_adder_dialog = function(spec) { return that; }; +phases.on('registration', function() { + var w = reg.widget; + var f = reg.field; + + w.register('rule_association_table', IPA.rule_association_table_widget); + f.register('rule_association_table', IPA.rule_association_table_field); +}); + return {}; }); \ No newline at end of file -- cgit