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
|
@ -144,7 +144,7 @@ var addAuthorForm = {
|
|||
|
||||
this.hideSelectedAuthor();
|
||||
|
||||
this.cancel.unbind('click');
|
||||
this.cancel.unbind('click');
|
||||
this.cancel.bind('click', function() {
|
||||
addAuthorForm.showAuthorListOnlyView();
|
||||
return false;
|
||||
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue