5e7305584a6f0553e7e9fa3736546bb755df22f8 tdreszer Thu Dec 12 12:56:39 2013 -0800 Fix for assembly changing between back-button calls. Redmine #7473 note41-43. diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js index c93a3c9..75f8f22 100644 --- src/hg/js/hgTracks.js +++ src/hg/js/hgTracks.js @@ -3140,38 +3140,38 @@ var curPos = encodeURIComponent(genomePos.get().replace(/,/g,'')); var cachedPos = imageV2.history.getState().data.position; // A) Forward: Full page retrieval: hgTracks is first navigated to (or chrom change) if (cachedPos == undefined) { // Not a back-button operation // set the current position into history outright (will replace). No img update needed imageV2.setInHistory(true); } else { // B) Back-button past a full retrieval genomePos.set(decodeURIComponent(cachedPos)); // B1) Dirty page: at least one non-position change if (imageV2.isDirtyPage()) { imageV2.markAsCleanPage(); // Only forcing a full page refresh if chrom changes var cachedChrom = decodeURIComponent(cachedPos).split(':')[0]; var curChrom = decodeURIComponent( curPos).split(':')[0]; if (cachedChrom == curChrom) { - imageV2.navigateInPlace("position=" + cachedPos, null, false); + imageV2.navigateInPlace("db="+getDb()+"&position=" + cachedPos, null, false); } else { imageV2.fullReload(); } } else { // B2) Clean page: only position changes from a->b if (cachedPos != curPos) { - imageV2.navigateInPlace("position=" + cachedPos, null, false); + imageV2.navigateInPlace("db="+getDb()+"&position=" + cachedPos, null, false); } } } }, setInHistory: function (fullPageLoad) { // Keep a position history and allow the back-button to work (sort of) // replaceState on initial page load, pushState on each advance // When call triggered by back button, the lastPos==newPos, so no action. var lastPos = imageV2.history.getState().data.position; var newPos = encodeURIComponent(genomePos.get().replace(/,/g,'')); // no commas // A full page load could be triggered by back-button, but then there will be a lastPos // if this is the case then don't set the position in history again! if (fullPageLoad && lastPos != undefined)