From d743b1dbf40215029bd895b9ae66f65279b9245b Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Wed, 2 Apr 2025 08:32:56 +0300 Subject: [PATCH] Set map hashes on place history pagination links --- app/assets/javascripts/index/history.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/app/assets/javascripts/index/history.js b/app/assets/javascripts/index/history.js index 50d3f70b9..4a1c05e4e 100644 --- a/app/assets/javascripts/index/history.js +++ b/app/assets/javascripts/index/history.js @@ -104,6 +104,10 @@ OSM.History = function (map) { function displayFirstChangesets(html) { $("#sidebar_content .changesets").html(html); + + if (location.pathname === "/history") { + setPaginationMapHashes(); + } } function displayMoreChangesets(div, html) { @@ -130,6 +134,19 @@ OSM.History = function (map) { nextNewList.children().appendTo(oldList); nextNewList.remove(); } + + if (location.pathname === "/history") { + setPaginationMapHashes(); + } + } + + function setPaginationMapHashes() { + $("#sidebar .pagination a").each(function () { + $(this).prop("hash", OSM.formatHash({ + center: map.getCenter(), + zoom: map.getZoom() + })); + }); } function loadFirstChangesets() { -- 2.39.5