NIHVIVO-749 Fixed incorrect behavior in authors form when user hits cancel button with autocomplete selections in view.

NIHVIVO-1056 Fixed first scenario, where first/middle name fields appear when autocomplete selection is made using tab.
This commit is contained in:
rjy7 2010-08-17 19:31:25 +00:00
parent 29152e8c78
commit ae3ec1d93e

View file

@ -498,9 +498,11 @@ var addAuthorForm = {
});
this.lastNameField.blur(function() {
// If personUri field has a value, the autocomplete select event has already fired;
// don't do anything.
if (addAuthorForm.personUriField.val()) {
// Cases where this event should be ignored:
// 1. personUri field has a value: the autocomplete select event has already fired.
// 2. The last name field is empty (especially since the field has focus when the form is displayed).
// 3. Autocomplete suggestions are showing.
if ( addAuthorForm.personUriField.val() || !$(this).val() || $('ul.ui-autocomplete li.ui-menu-item').length ) {
return;
}
addAuthorForm.onLastNameChange();