X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/c441a4dc15f2de78e6c43a51a850b394a25aa5a9..1b8a5a8f1510299ff039feb437d89f89d1b7a406:/app/assets/javascripts/index/history.js diff --git a/app/assets/javascripts/index/history.js b/app/assets/javascripts/index/history.js index c36ae5f18..6e4e73a23 100644 --- a/app/assets/javascripts/index/history.js +++ b/app/assets/javascripts/index/history.js @@ -58,7 +58,7 @@ OSM.History = function (map) { function update() { const data = new URLSearchParams(); - if (window.location.pathname === "/history") { + if (location.pathname === "/history") { data.set("bbox", map.getBounds().wrap().toBBoxString()); const feedLink = $("link[type=\"application/atom+xml\"]"), feedHref = feedLink.attr("href").split("?")[0]; @@ -67,7 +67,7 @@ OSM.History = function (map) { data.set("list", "1"); - fetch(window.location.pathname + "?" + data) + fetch(location.pathname + "?" + data) .then(response => response.text()) .then(function (html) { displayFirstChangesets(html); @@ -137,7 +137,7 @@ OSM.History = function (map) { updateBounds(); - if (window.location.pathname !== "/history") { + if (location.pathname !== "/history") { const bounds = group.getBounds(); if (bounds.isValid()) map.fitBounds(bounds); } @@ -150,7 +150,7 @@ OSM.History = function (map) { page.load = function () { map.addLayer(group); - if (window.location.pathname === "/history") { + if (location.pathname === "/history") { map.on("moveend", update); }