From 8cc0fa936843b78f2a48be42a729d334ef6c39fc Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sat, 21 Dec 2019 20:10:49 -0500 Subject: [PATCH] Remove unnecessary registerField process --- ext/afform/core/ang/af/Entity.js | 1 - ext/afform/core/ang/af/Fieldset.js | 4 ---- ext/afform/core/ang/af/Form.js | 3 --- 3 files changed, 8 deletions(-) diff --git a/ext/afform/core/ang/af/Entity.js b/ext/afform/core/ang/af/Entity.js index fdb791e20f..2c522a6030 100644 --- a/ext/afform/core/ang/af/Entity.js +++ b/ext/afform/core/ang/af/Entity.js @@ -18,7 +18,6 @@ var ts = $scope.ts = CRM.ts('afform'), entity = _.pick($scope, _.keys(modelProps)); entity.id = null; - entity.fields = []; afFormCtrl.registerEntity(entity); // $scope.$watch('afEntity', function(newValue){$scope.myOptions = newValue;}); } diff --git a/ext/afform/core/ang/af/Fieldset.js b/ext/afform/core/ang/af/Fieldset.js index 47da042458..69dde11b15 100644 --- a/ext/afform/core/ang/af/Fieldset.js +++ b/ext/afform/core/ang/af/Fieldset.js @@ -9,10 +9,6 @@ }, link: function($scope, $el, $attr, afFormCtrl) { $scope.afFormCtrl = afFormCtrl; - // This is faster than waiting for each field directive to register itself - $('af-field', $el).each(function() { - afFormCtrl.registerField($scope.modelName, $(this).attr('name')); - }); }, controller: function($scope){ this.getDefn = function getDefn() { diff --git a/ext/afform/core/ang/af/Form.js b/ext/afform/core/ang/af/Form.js index 1083ebc634..6ca2e47fa3 100644 --- a/ext/afform/core/ang/af/Form.js +++ b/ext/afform/core/ang/af/Form.js @@ -22,9 +22,6 @@ schema[entity.modelName] = entity; data[entity.modelName] = entity.data || {}; }; - this.registerField = function(entityName, fieldName) { - schema[entityName].fields.push(fieldName); - }; this.getEntity = function getEntity(name) { return schema[name]; }; -- 2.25.1