Parcourir la source

Don't record an item in the browser history each time the user moves the view of a panorama

Baptiste Jonglez il y a 9 ans
Parent
commit
d38c717878
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  1. 3 1
      panorama/static/panorama/js/pano.js

+ 3 - 1
panorama/static/panorama/js/pano.js

@@ -1011,7 +1011,9 @@ function get_orientation_from_url() {
 function update_url() {
     var x = last.x << zm.value;
     var y = image_height - (last.y << zm.value);
-    window.location.hash = "#zoom=" + zm.value + "/x=" + x + "/y=" + y;
+    // Important: don't set window.location.hash directly, because it
+    // records a new entry in the browser history...
+    window.location.replace("#zoom=" + zm.value + "/x=" + x + "/y=" + y);
 }
 
 function load_pano() {