Only apply autocomplete to fields not yet enabled

In some cases, double-applying it caused weird behavior. Filtering out fields
that have already been autocomplete-enabled fixes #971 and probably other edge
cases, too.
This commit is contained in:
Eric Allen 2009-12-20 13:19:17 -05:00
parent 9ddd5c5d2a
commit 649ea6bf63

View file

@ -187,11 +187,11 @@ function project_defaults(){
function enable_rich_interaction(){ function enable_rich_interaction(){
$('input.Date').datepicker({'dateFormat': dateFormat}); $('input.Date').datepicker({'dateFormat': dateFormat});
/* Autocomplete */ /* Autocomplete */
$('input[name=context_name]').autocomplete(contextNames, {matchContains: true}); $('input[name=context_name]:not(.ac_input)').autocomplete(contextNames, {matchContains: true});
$('input[name=project[default_context_name]]').autocomplete(contextNames, {matchContains: true}); $('input[name=project[default_context_name]]:not(.ac_input)').autocomplete(contextNames, {matchContains: true});
$('input[name=project_name]').autocomplete(projectNames, {matchContains: true}); $('input[name=project_name]:not(.ac_input)').autocomplete(projectNames, {matchContains: true});
$('input[name=tag_list]').autocomplete(tagNames, {multiple: true,multipleSeparator:',',matchContains:true}); $('input[name=tag_list]:not(.ac_input)').autocomplete(tagNames, {multiple: true,multipleSeparator:',',matchContains:true});
$('input[name=predecessor_list]').autocomplete('/todos/auto_complete_for_predecessor', $('input[name=predecessor_list]:not(.ac_input)').autocomplete('/todos/auto_complete_for_predecessor',
{multiple: true,multipleSeparator:','}); {multiple: true,multipleSeparator:','});
/* have to bind on keypress because of limitataions of live() */ /* have to bind on keypress because of limitataions of live() */