X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/cfd2c5dddab88372905a23f7b9680df58feb9b53..a3c45f6ed66862ee394e2a207dedf400acef9b07:/app/assets/javascripts/router.js diff --git a/app/assets/javascripts/router.js b/app/assets/javascripts/router.js index 30a71e0f1..63a320c6a 100644 --- a/app/assets/javascripts/router.js +++ b/app/assets/javascripts/router.js @@ -142,11 +142,8 @@ OSM.Router = function (map, rts) { }; router.stateChange = function (state) { - if (state.center) { - window.history.replaceState(state, document.title, OSM.formatHash(state)); - } else { - window.history.replaceState(state, document.title, window.location); - } + const url = state.center ? OSM.formatHash(state) : window.location; + window.history.replaceState(state, document.title, url); }; router.updateHash = function () {