156e33d1f6639d0923249d8dfa300b0cec522ff4
larrym
  Thu Jun 28 10:45:25 2012 -0700
change selectCallback so callback has more info
diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js
index dd5b105..6fbb36e 100644
--- src/hg/js/hgTracks.js
+++ src/hg/js/hgTracks.js
@@ -2884,32 +2884,30 @@
     {   // onClick handler for the "jump" button.
         // Handles situation where user types a gene name into the gene box and immediately hits the jump button,
         // expecting the browser to jump to that gene.
         var gene = $('#suggest').val();
         var db = getDb();
         if(gene
         && gene.length > 0
         && gene != "gene"
         && db
         && $('#positionDisplay').length == 0
         && (genomePos.getOriginalPos() == genomePos.get() || genomePos.get().length == 0)) {
             var pos = lookupGene(db, gene);
             if(pos) {
                 vis.makeTrackVisible($("#suggestTrack").val());
                 genomePos.set(pos, null);
-                // Following doesn't work b/c we get the hugo symbol from the suggest list, not the known gene id.
-                // $(document.TrackForm || document.TrackHeaderForm).append("<input type='hidden' name='hgFind.matches' " + "value='" + name + "'>");
             } else {
                 // turn this into a full text search.
                 genomePos.set(gene, null);
             }
         }
         return true;
     },
 
     navigateInPlace: function (params, disabledEle, keepCurrentTrackVisible)
     {
     // request an hgTracks image, using params
     // disabledEle is optional; this element will be enabled when update is complete
     // If keepCurrentTrackVisible is true, we try to maintain relative position of the item under the mouse after the in-place update.
         // Tim thinks we should consider disabling all UI input while we are doing in-place update.
         jQuery('body').css('cursor', 'wait');
@@ -2998,33 +2996,38 @@
     // If so, then this code should detect if the image has been changed via js/ajax
     // and will reload the image if necessary.
     // NOTE: this is needed for IE but other browsers can detect the dirty page much earlier
     if (imageV2.isDirtyPage()) {
         // mark as non dirty to avoid infinite loop in chrome.
         $('#dirty').val('false');
         jQuery('body').css('cursor', 'wait');
             window.location = "../cgi-bin/hgTracks?hgsid=" + getHgsid();
             return false;
     }
     initVars();
 
     var db = getDb();
     if($('#positionInput').length) {
         suggestBox.init(db, hgTracks.assemblySupportsGeneSuggest,
-             function (position) {
-                  genomePos.set(position, commify(getSizeFromCoordinates(position)));
+             function (item) {
+                  genomePos.set(item.id, commify(getSizeFromCoordinates(item.id)));
                   vis.makeTrackVisible($("#suggestTrack").val());
+// Initial attempt to fix #6330 - however, this does not deal with user editing the search box
+//                  if($('#hgFindMatches').length)
+//                      $('#hgFindMatches').val(item.internalId);
+//                  else
+//                      $(document.TrackForm || document.TrackHeaderForm).append("<input type='hidden' id='hgFindMatches' name='hgFind.matches' " + "value='" + item.internalId + "'>");
              },
              function (position) {
                   genomePos.set(position, commify(getSizeFromCoordinates(position)));
              });
         // I want to set focus to the suggest element, but unforunately that prevents PgUp/PgDn from
         // working, which is a major annoyance.
         // $('#positionInput').focus();
     }
     // Convert map AREA gets to post the form, ensuring that cart variables are kept up to date (but turn this off for search form).
     if($("FORM").length > 0 && $('#trackSearch').length == 0) {
         var allLinks = $('a');
         $( allLinks ).unbind('click');
         $( allLinks ).click( posting.saveSettings );
     }
     if($('#pdfLink').length == 1) {