]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/router.js
Merge branch 'master' into routing
[rails.git] / app / assets / javascripts / router.js
index dcf8ea6a8cbad7aa45c8a2717e71f67fdf19b6e0..904134fc078630cedbd86c5f0771abafa950e366 100644 (file)
@@ -127,6 +127,10 @@ OSM.Router = function(map, rts) {
       return true;
     };
 
+    router.replace = function (url) {
+      window.history.replaceState(OSM.parseHash(url), document.title, url);
+    };
+
     router.stateChange = function(state) {
       if (state.center) {
         window.history.replaceState(state, document.title, OSM.formatHash(state));
@@ -135,7 +139,7 @@ OSM.Router = function(map, rts) {
       }
     };
   } else {
-    router.route = function (url) {
+    router.route = router.replace = function (url) {
       window.location.assign(url);
     };