X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/cfd2c5dddab88372905a23f7b9680df58feb9b53..70e1a23248922af1f6f31360d542335c67be36cf:/app/assets/javascripts/index/history.js diff --git a/app/assets/javascripts/index/history.js b/app/assets/javascripts/index/history.js index 3c7101c74..52929018b 100644 --- a/app/assets/javascripts/index/history.js +++ b/app/assets/javascripts/index/history.js @@ -56,24 +56,23 @@ OSM.History = function (map) { } function update() { - var data = { list: "1" }; + const data = new URLSearchParams(); if (window.location.pathname === "/history") { - data.bbox = map.getBounds().wrap().toBBoxString(); + data.set("bbox", map.getBounds().wrap().toBBoxString()); var feedLink = $("link[type=\"application/atom+xml\"]"), feedHref = feedLink.attr("href").split("?")[0]; - feedLink.attr("href", feedHref + "?bbox=" + data.bbox); + feedLink.attr("href", feedHref + "?" + data); } - $.ajax({ - url: window.location.pathname, - method: "GET", - data: data, - success: function (html) { + data.set("list", "1"); + + fetch(window.location.pathname + "?" + data) + .then(response => response.text()) + .then(function (html) { displayFirstChangesets(html); updateMap(); - } - }); + }); } function loadMore(e) {