31f2c965632c23b0e0982d5a2f71de429bdda4eb larrym Mon Mar 7 17:10:17 2011 -0800 use built-in autocomplete if newJQuery is true diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js index 003b2a7..518bf96 100644 --- src/hg/js/hgTracks.js +++ src/hg/js/hgTracks.js @@ -1184,48 +1184,51 @@ var thisForm=$(obj).parents('form'); if(thisForm == undefined || $(thisForm).length == 0) thisForm=$("FORM"); if($(thisForm).length > 1 ) thisForm=$(thisForm)[0]; if(thisForm != undefined && $(thisForm).length == 1) { //alert("posting form:"+$(thisForm).attr('name')); return postTheForm($(thisForm).attr('name'),obj.href); } return true; } $(document).ready(function() { var db = getDb(); + if(document.getElementById("hgt.newJQuery") != null) { + newJQuery = true; + } if(jQuery.fn.autocomplete && $('input#suggest') && db) { if(newJQuery) { $('input#suggest').autocomplete({ delay: 500, minLength: 2, - source: ajaxGet(function () {return db;}, new Object), + source: ajaxGet(function () {return db;}, new Object, true), select: function (event, ui) { setPosition(ui.item.id, commify(getSizeFromCoordinates(ui.item.id))); // jQuery('body').css('cursor', 'wait'); // document.TrackHeaderForm.submit(); } }); } else { $('input#suggest').autocomplete({ delay: 500, minchars: 2, - ajax_get: ajaxGet(function () {return db;}, new Object), + ajax_get: ajaxGet(function () {return db;}, new Object, false), callback: function (obj) { setPosition(obj.id, commify(getSizeFromCoordinates(obj.id))); // jQuery('body').css('cursor', 'wait'); // document.TrackHeaderForm.submit(); } }); } // I want to set focus to the suggest element, but unforunately that prevents PgUp/PgDn from // working, which is a major annoyance. // $('input#suggest').focus(); } initVars(); if(jQuery.jStore) { // Experimental (currently dead) code to handle "user hits back button" problem.