X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/e11d734f9f965464510dd109970501861001ee5c..56b2fdf5c9915b02c8bf051e4f82927ae72c8c41:/app/assets/javascripts/router.js diff --git a/app/assets/javascripts/router.js b/app/assets/javascripts/router.js index dcf8ea6a8..904134fc0 100644 --- a/app/assets/javascripts/router.js +++ b/app/assets/javascripts/router.js @@ -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); };