From 1b45d59529d78b93fa01b44f7c8f8356629ec454 Mon Sep 17 00:00:00 2001 From: rjy7 Date: Thu, 23 Sep 2010 20:26:01 +0000 Subject: [PATCH] Fixed bug in interaction with autocomplete help text and other changes on the trunk --- productMods/edit/forms/js/customFormWithAutocomplete.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/productMods/edit/forms/js/customFormWithAutocomplete.js b/productMods/edit/forms/js/customFormWithAutocomplete.js index 3bcd5661..1db7cbcc 100644 --- a/productMods/edit/forms/js/customFormWithAutocomplete.js +++ b/productMods/edit/forms/js/customFormWithAutocomplete.js @@ -461,11 +461,12 @@ var customForm = { return this.acType ? this.typeName : this.capitalize(this.defaultTypeName); }, - // Set the intial help text that appears in the autocomplete field and change the class name + // Set the initial help text that appears in the autocomplete field and change the class name addAcHelpText: function() { var typeText; - - if (!this.acSelector.val()) { + + // First case applies on page load; second case applies when the type gets changed. + if (!this.acSelector.val() || this.acSelector.hasClass(this.acHelpTextClass)) { typeText = this.getTypeNameForLabels(); this.acSelector.val("Select an existing " + typeText + " or create a new one.") .addClass(this.acHelpTextClass);