From d35c2913b4aa5ce92306b9f4031acc38dc9d4b54 Mon Sep 17 00:00:00 2001 From: kurund Date: Sun, 26 Jan 2014 00:01:22 -0500 Subject: [PATCH] renamed function to be more intuitive --- js/model/crm.uf.js | 2 +- js/view/crm.designer.js | 2 +- js/view/crm.profile-selector.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/js/model/crm.uf.js b/js/model/crm.uf.js index 907e108d45..f75cbbff8d 100644 --- a/js/model/crm.uf.js +++ b/js/model/crm.uf.js @@ -682,7 +682,7 @@ }); return allMatched; }, - getUFGroupModel: function() { + calculateContactEntityType: function() { var ufGroupModel = this; // set proper entity model based on selected profile diff --git a/js/view/crm.designer.js b/js/view/crm.designer.js index 26b93d076d..de2e88ab04 100644 --- a/js/view/crm.designer.js +++ b/js/view/crm.designer.js @@ -327,7 +327,7 @@ _.each(ufEntityModel.getSections(), function(section, sectionKey){ var defaultValue = paletteView.selectedContactType; if (!defaultValue) { - defaultValue = paletteView.model.getUFGroupModel(); + defaultValue = paletteView.model.calculateContactEntityType(); } // set selected option as default, since we are rebuilding palette diff --git a/js/view/crm.profile-selector.js b/js/view/crm.profile-selector.js index 75977cc83d..306279a250 100644 --- a/js/view/crm.profile-selector.js +++ b/js/view/crm.profile-selector.js @@ -115,7 +115,7 @@ success: function(formData) { // Note: With chaining, API returns some extraneous keys that aren't part of UFGroupModel var ufGroupModel = new CRM.UF.UFGroupModel(_.pick(formData, _.keys(CRM.UF.UFGroupModel.prototype.schema))); - ufGroupModel.setUFGroupModel(ufGroupModel.getUFGroupModel(), profileSelectorView.options.ufEntities); + ufGroupModel.setUFGroupModel(ufGroupModel.calculateContactEntityType(), profileSelectorView.options.ufEntities); ufGroupModel.getRel('ufFieldCollection').reset(_.values(formData["api.UFField.get"].values)); options.onLoad(ufGroupModel); } @@ -137,7 +137,7 @@ success: function(formData) { // Note: With chaining, API returns some extraneous keys that aren't part of UFGroupModel var ufGroupModel = new CRM.UF.UFGroupModel(_.pick(formData, _.keys(CRM.UF.UFGroupModel.prototype.schema))); - ufGroupModel.setUFGroupModel(ufGroupModel.getUFGroupModel(), profileSelectorView.options.ufEntities); + ufGroupModel.setUFGroupModel(ufGroupModel.calculateContactEntityType(), profileSelectorView.options.ufEntities); ufGroupModel.getRel('ufFieldCollection').reset(_.values(formData["api.UFField.get"].values)); options.onLoad(ufGroupModel.deepCopy()); } -- 2.25.1