74f0ebe561bc27c396ea2a035a52149a9d42fe1a
tdreszer
  Fri Dec 6 11:00:00 2013 -0800
Fixed edge case bug in history that Max found.  Redmine 12253.
diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js
index db5d5d6..c93a3c9 100644
--- src/hg/js/hgTracks.js
+++ src/hg/js/hgTracks.js
@@ -3111,30 +3111,31 @@
             if (prevPos != undefined && prevPos != curPos) {
                 // NOTE: this function is NOT called when backing passed a full retrieval boundary
                 genomePos.set(decodeURIComponent(prevPos));
                 imageV2.navigateInPlace("position=" + prevPos, null, false);
             }
         });
         
         // TODO: move elsewhere?
         // With history support it is best that most position changes will ajax-update the image
         // This ensures that the 'go' and 'refresh' button will do so unless the chrom changes.
         $("input[value='go'],input[value='refresh']").click(function () {
             var newPos = genomePos.get().replace(/,/g,'');
             var newChrom = newPos.split(':')[0];
             var oldChrom  = genomePos.getOriginalPos().split(':')[0];
             if (newChrom == oldChrom) {
+                imageV2.markAsDirtyPage();
                 imageV2.navigateInPlace("position="+encodeURIComponent(newPos), null, false);
                 return false;
             }
             return true;
         });
         // Have vis box changes update cart through ajax.  This helps keep page/cart in sync.
         vis.initForAjax();
 
         // We reach here from these possible paths:
         // A) Forward: Full page retrieval: hgTracks is first navigated to (or chrom change)
         // B) Back-button past a full retrieval (B in: ->A,->b,->c(full page),->d,<-c,<-B(again))
         //    B1) Dirty page: at least one non-position change (e.g. 1 track vis changed in b)
         //    B2) Clean page: only position changes from A->b->| 
         var curPos = encodeURIComponent(genomePos.get().replace(/,/g,''));
         var cachedPos = imageV2.history.getState().data.position;