From dc83b2655140c2a24f8755f1dc9f26519cc8e294 Mon Sep 17 00:00:00 2001 From: tworrall Date: Tue, 19 Jun 2012 20:05:31 +0000 Subject: [PATCH] initFormFullView was being called twice in edit mode; also in edit mode acSelection label was not being changed --- .../edit/forms/js/customFormWithAutocomplete.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/productMods/templates/freemarker/edit/forms/js/customFormWithAutocomplete.js b/productMods/templates/freemarker/edit/forms/js/customFormWithAutocomplete.js index a406d54e..c74a030a 100644 --- a/productMods/templates/freemarker/edit/forms/js/customFormWithAutocomplete.js +++ b/productMods/templates/freemarker/edit/forms/js/customFormWithAutocomplete.js @@ -136,7 +136,6 @@ var customForm = { // if ((!this.supportEdit) && (this.editMode == 'edit' || this.editMode == 'repair')) { if (this.editMode == 'edit' || this.editMode == 'repair') { this.initFormWithValidationErrors(); - this.initFormFullView(); } else if (this.findValidationErrors()) { this.initFormWithValidationErrors(); @@ -164,8 +163,7 @@ var customForm = { this.cancel.unbind('click'); }, - initFormFullView: function() { - + initFormFullView: function(source) { this.setType(); this.fullViewOnly.show(); this.or.show(); @@ -202,6 +200,7 @@ var customForm = { // Call initFormFullView first, because showAutocompleteSelection needs // acType, which is set in initFormFullView. this.initFormFullView(); + $.each(this.acSelectors, function() { var $acSelection = customForm.acSelections[$(this).attr('acGroupName')]; @@ -546,6 +545,10 @@ var customForm = { if (selectedType.val().length) { this.acTypes[acTypeKey] = selectedType.val(); this.typeName = selectedType.html(); + if ( this.editMode == 'edit' ) { + var $acSelect = this.acSelections[acTypeKey]; + $acSelect.find('label').html('Selected ' + this.typeName + ':'); + } } // reset to empty values; may not need else {