# HG changeset patch # User Franck Deroche # Date 1233053721 -3600 # Node ID 1f9c278126f964c716ec033f6401c7c0eb1bf75d # Parent 281e131cb6c3347633dfa35579b55c1440dc0512 Don't put the value twice in autocomplete fields. diff -r 281e131cb6c3 -r 1f9c278126f9 noderef_view.js --- a/noderef_view.js Tue Jan 27 11:54:25 2009 +0100 +++ b/noderef_view.js Tue Jan 27 11:55:21 2009 +0100 @@ -25,10 +25,12 @@ var selection = noderef_view_get_selection(), left = []; for(nid in selection) { count = 0; + // Let's compute the potential value for autocomplete fields + acvalue = selection[nid] +' [nid:'+ nid +']'; // Autocomplete field - count += $('input.form-autocomplete:not([value])', wrapper) + count += $('input.form-autocomplete[value="'+ acvalue +'"], input.form-autocomplete:not([value])', wrapper) .filter(':first') - .val(selection[nid]) + .val(acvalue) .length; // Select field (exclude the weight of autocomplete fields) count += $('select:not([id$="--weight"])', wrapper).val(nid).length;