e26e2aa9d43fcf39f65f9f66c23ffc088bc95047 larrym Fri Jun 29 13:38:26 2012 -0700 add hgFind.matches only if last thing user did was to choose from suggest diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js index d56a098..9db176e 100644 --- src/hg/js/hgTracks.js +++ src/hg/js/hgTracks.js @@ -2972,38 +2972,42 @@ // 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 (item) { genomePos.set(item.id, commify(getSizeFromCoordinates(item.id))); - vis.makeTrackVisible($("#suggestTrack").val()); }, 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(); + // Make sure suggestTrack is visible when user chooses something via gene select (#3484). + if($("#suggestTrack").length) { + $(document.TrackHeaderForm).submit(function(event) { + if($('#hgFindMatches').length) { + vis.makeTrackVisible($("#suggestTrack").val()); + } + }); + } } // 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) { $('#pdfLink').click(function(i) { var thisForm=$('#TrackForm'); if(thisForm != undefined && $(thisForm).length == 1) { //alert("posting form:"+$(thisForm).attr('name')); updateOrMakeNamedVariable($(thisForm),'hgt.psOutput','on'); return postTheForm($(thisForm).attr('name'),this.href); }