]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index/history.js
Allow searching users by IP subnet
[rails.git] / app / assets / javascripts / index / history.js
index 3c7101c7408095d3f45be0f6e0fa263cadfb39ba..52929018bbd60886c3e3528f4ccb4be0d04ed5c2 100644 (file)
@@ -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) {