From c083096442e4c354c4900474d35f1529ddd4503f Mon Sep 17 00:00:00 2001 From: rjy7 Date: Tue, 17 Aug 2010 20:33:27 +0000 Subject: [PATCH] NIHVIVO-1056 Problem of autocomplete selection using arrow keys: jQuery UI makes it look like a selection is made, but it doesn't trigger the select event. Need further exploration. --- .../edit/forms/js/addAuthorsToInformationResource.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/productMods/edit/forms/js/addAuthorsToInformationResource.js b/productMods/edit/forms/js/addAuthorsToInformationResource.js index 206ff3ce..adaf38ec 100644 --- a/productMods/edit/forms/js/addAuthorsToInformationResource.js +++ b/productMods/edit/forms/js/addAuthorsToInformationResource.js @@ -189,11 +189,11 @@ var addAuthorForm = { minLength: 2, source: function(request, response) { if (request.term in addAuthorForm.acCache) { - //console.log('found term in cache'); + // console.log('found term in cache'); response(addAuthorForm.acCache[request.term]); return; } - //console.log('not getting term from cache'); + // console.log('not getting term from cache'); // If the url query params are too long, we could do a post // here instead of a get. Add the exclude uris to the data @@ -516,6 +516,12 @@ var addAuthorForm = { addAuthorForm.onLastNameChange(); return false; // don't submit form } + // TimW would like to be able to make a selection using the arrow keys, but jQuery UI doesn't recognize + // that as a selection unless you actually hit enter or click the mouse on it. We could trigger the event, + // as shown, but need to pass in the ui item for it to work. Think more about this. + // else if (event.which === 38 || event.which === 40) { + // addAuthorForm.lastNameField.autocomplete('option', 'select')(); + // } }); this.removeAuthorshipLinks.click(function() { @@ -596,7 +602,6 @@ var addAuthorForm = { url: $(link).attr('href'), type: 'POST', data: { - //deletion: $(link).parents('.authorship').attr('id') deletion: $(link).parents('.authorship').data('authorshipUri') }, dataType: 'json',