cb4c22a814d2a23d93d63cd621333be7529a36b2
chmalee
  Fri Jul 22 15:24:08 2022 -0700
Make gene selections on hgGateway automatically go to hgTracks

diff --git src/hg/js/hgGateway.js src/hg/js/hgGateway.js
index 4ad291a..a942dfb 100644
--- src/hg/js/hgGateway.js
+++ src/hg/js/hgGateway.js
@@ -1066,34 +1066,40 @@
         var matches = fourDigits.exec(posComma);
         while (matches) {
             posComma = matches[1] + ',' + matches[2];
             matches = fourDigits.exec(posComma);
         }
         return posComma;
     }
 
     function onSelectGene(item) {
         // Set the position from an autocomplete result;
         // set hgFindMatches and make sure suggestTrack is in pack mode for highlighting the match.
         var newPos = item.id;
         var newPosComma = addCommasToPosition(newPos);
         var settings;
         $('#positionDisplay').text(newPosComma);
+        function onSuccess(jqXHR, textStatus) {
+            goToHgTracks();
+        }
+        function onFail(jqXHR, textStatus) {
+            cart.defaultErrorCallback(jqXHR, textStatus);
+        }
         if (uiState.suggestTrack) {
             settings = { 'hgFind.matches': item.internalId };
             settings[uiState.suggestTrack] = 'pack';
-            cart.send({ cgiVar: settings });
+            cart.send({ cgiVar: settings }, onSuccess , onFail);
             cart.flush();
         }
         function overwriteWithGene() {
             $('#positionInput').val(item.geneSymbol);
         }
         if (item.geneSymbol) {
             selectedGene = item.geneSymbol;
             // Overwrite item's long value with symbol after the autocomplete plugin is done:
             window.setTimeout(overwriteWithGene, 0);
         } else {
             selectedGene = item.value;
         }
     }
 
     function setAssemblyOptions(uiState) {