]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index/history.js
Add 'before' parameter to history pages
[rails.git] / app / assets / javascripts / index / history.js
index 6e4e73a23fa7e5564bcad943a6b78f4111a96680..dddd84354473d6a126895b1f738f6261b40cfda5 100644 (file)
@@ -57,6 +57,7 @@ OSM.History = function (map) {
 
   function update() {
     const data = new URLSearchParams();
+    const params = new URLSearchParams(location.search);
 
     if (location.pathname === "/history") {
       data.set("bbox", map.getBounds().wrap().toBBoxString());
@@ -67,6 +68,10 @@ OSM.History = function (map) {
 
     data.set("list", "1");
 
+    if (params.has("before")) {
+      data.set("before", params.get("before"));
+    }
+
     fetch(location.pathname + "?" + data)
       .then(response => response.text())
       .then(function (html) {