diff options
author | Petr Vobornik <pvoborni@redhat.com> | 2013-04-12 19:50:28 +0200 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2013-05-06 16:22:25 +0200 |
commit | 86f0b5eb64b87a34e9f66f0083c6ac789fb8f699 (patch) | |
tree | 956549b920e2dd9864fae0d8a3e88b1f5d4d4994 /install/ui/src/freeipa/entity.js | |
parent | a901f8b0e73338d93078ad1ee44e23300007365c (diff) | |
download | freeipa-86f0b5eb64b87a34e9f66f0083c6ac789fb8f699.tar.gz freeipa-86f0b5eb64b87a34e9f66f0083c6ac789fb8f699.tar.xz freeipa-86f0b5eb64b87a34e9f66f0083c6ac789fb8f699.zip |
Use entities module for entity registration, build and holding
https://fedorahosted.org/freeipa/ticket/3235
Diffstat (limited to 'install/ui/src/freeipa/entity.js')
-rw-r--r-- | install/ui/src/freeipa/entity.js | 38 |
1 files changed, 11 insertions, 27 deletions
diff --git a/install/ui/src/freeipa/entity.js b/install/ui/src/freeipa/entity.js index e20efc0f4..3e054467c 100644 --- a/install/ui/src/freeipa/entity.js +++ b/install/ui/src/freeipa/entity.js @@ -41,7 +41,6 @@ IPA.entity = function(spec) { that.defines_key = spec.defines_key !== undefined ? spec.defines_key : true; that.metadata = spec.metadata; - that.builder = spec.builder; that.dialogs = $.ordered_map(); that.dialog_specs = spec.dialogs || []; @@ -180,41 +179,21 @@ IPA.entity = function(spec) { return that; }; + that.builder = spec.builder || IPA.entity_builder(that); + that.entity_init = that.init; return that; }; -IPA.entity_builder = function() { +IPA.entity_builder = function(entity) { var that = IPA.object(); - var entity = null; var facet_group = null; var facet = null; var section = null; - that.entity = function(spec) { - var factory = IPA.entity; - if (spec instanceof Object) { - factory = spec.$factory || IPA.entity; - } else { - spec = { name: spec }; - } - spec.builder = that; - - entity = factory(spec); - - that.facet_groups([ - 'member', - 'settings', - 'memberof', - 'managedby' - ]); - - return that; - }; - that.facet_group = function(spec) { spec.entity = entity; if (spec instanceof Object) { @@ -427,9 +406,14 @@ IPA.entity_builder = function() { return that.dialog(spec); }; - that.build = function(){ - return entity; - }; + that.facet_groups([ + 'member', + 'settings', + 'memberof', + 'managedby' + ]); + + return that; }; |