summaryrefslogtreecommitdiffstats
path: root/install/ui/src/freeipa/entity.js
diff options
context:
space:
mode:
Diffstat (limited to 'install/ui/src/freeipa/entity.js')
-rw-r--r--install/ui/src/freeipa/entity.js38
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;
};