in custom forms with typeSelector, second autocomplete label was not set correctly

This commit is contained in:
tworrall 2012-03-06 15:37:11 +00:00
parent 4782e06ff3
commit 06d6c70cfc
2 changed files with 6 additions and 3 deletions

View file

@ -124,7 +124,7 @@
</p> </p>
<div class="acSelection" acGroupName="conference"> <div class="acSelection" acGroupName="conference">
<p class="inline"> <p class="inline">
<label>Selected Conference:</label> <label>Selected conference:</label>
<span class="acSelectionInfo"></span> <span class="acSelectionInfo"></span>
<a href="" class="verifyMatch" title="verify match">(Verify this match</a> or <a href="" class="verifyMatch" title="verify match">(Verify this match</a> or
<a href="#" class="changeSelection" id="changeSelection">change selection)</a> <a href="#" class="changeSelection" id="changeSelection">change selection)</a>

View file

@ -391,12 +391,15 @@ var customForm = {
// If the form has a type selector, add type name to label in add mode. In edit mode, use typeSelectorSpan // If the form has a type selector, add type name to label in add mode. In edit mode, use typeSelectorSpan
// html. The second case is an "else if" and not an else because the template may not be passing the label // html. The second case is an "else if" and not an else because the template may not be passing the label
// to the acSelection macro or it may not be using the macro at all and the label is hard-coded in the html. // to the acSelection macro or it may not be using the macro at all and the label is hard-coded in the html.
if (this.typeSelector.length) { if ( this.typeSelector.length && ($acDiv.attr('acGroupName') == this.typeSelector.attr('acGroupName')) ) {
$acDiv.find('label').html('Selected ' + this.typeName + ':'); $acDiv.find('label').html('Selected ' + this.typeName + ':');
} }
else if ( this.typeSelectorSpan.html() ) { else if ( this.typeSelectorSpan.html() && ($acDiv.attr('acGroupName') == this.typeSelectorInput.attr('acGroupName')) ) {
$acDiv.find('label').html('Selected ' + this.typeSelectorSpan.html() + ':'); $acDiv.find('label').html('Selected ' + this.typeSelectorSpan.html() + ':');
} }
else if ( $acDiv.find('label').html() == '' ) {
$acDiv.find('label').html('Selected ' + this.multipleTypeNames[$(selectedObj).attr('acGroupName')] + ':');
}
$acDiv.show(); $acDiv.show();
$acDiv.find("input").val(uri); $acDiv.find("input").val(uri);