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:
parent
29152e8c78
commit
ae3ec1d93e
1 changed files with 6 additions and 4 deletions
|
@ -498,9 +498,11 @@ var addAuthorForm = {
|
||||||
});
|
});
|
||||||
|
|
||||||
this.lastNameField.blur(function() {
|
this.lastNameField.blur(function() {
|
||||||
// If personUri field has a value, the autocomplete select event has already fired;
|
// Cases where this event should be ignored:
|
||||||
// don't do anything.
|
// 1. personUri field has a value: the autocomplete select event has already fired.
|
||||||
if (addAuthorForm.personUriField.val()) {
|
// 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;
|
return;
|
||||||
}
|
}
|
||||||
addAuthorForm.onLastNameChange();
|
addAuthorForm.onLastNameChange();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue