X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/1b20b5187ec1b150947089472a52c885cdd26ddb..5047ec403db94b0d371a9a10b56801bc0a3fcf0a:/app/assets/javascripts/router.js?ds=inline 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 () {