d8357a44b9fb15ee8262a36d4fbcc43c90fae358
chmalee
  Mon Dec 14 16:42:26 2020 -0800
Make hgGateway use previously browsed position when changing databases, also fix hgHubConnect assembly redirect to use last used position, refs #14481

diff --git src/hg/js/hgGateway.js src/hg/js/hgGateway.js
index 72a1b59..cef5348 100644
--- src/hg/js/hgGateway.js
+++ src/hg/js/hgGateway.js
@@ -1442,31 +1442,31 @@
         setTaxId(taxId, null, false, true);
     }
 
     function onClickHubName(hubUrl, taxId, db, hubName) {
         // This is just a wrapper -- the draw module has to know all about the contents
         // of each hub object in hubList anyway.
         setHubDb(hubUrl, taxId, db, hubName, false);
     }
 
     function onChangeDbMenu() {
         // The user selected a different db for this genome; get db info from server.
         var db = $('#selectAssembly').val();
         var cmd;
         if (db !== uiState.db) {
             setAssemblyDescriptionTitle(db, uiState.genome);
-            cmd = { setDb: { db: db } };
+            cmd = { setDb: { db: db, position: "lastDbPos" } };
             if (uiState.hubUrl) {
                 cmd.setDb.hubUrl = uiState.hubUrl;
             }
             cart.send(cmd, handleSetDb);
             cart.flush();
             uiState.db = db;
             clearPositionInput();
         }
     }
 
     function onClickCopyPosition() {
         // Copy the displayed position into the position input:
         var posDisplay = $('#positionDisplay').text();
         $('#positionInput').val(posDisplay).focus();
     }