X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/d095dfe3d4c1ec90cebdfb3307564022cbeaf878..3d3b2b47964ec91ef1ab1946b7258a06665caced:/app/assets/javascripts/index.js diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 194ed82f7..4903703cd 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -297,19 +297,19 @@ $(document).ready(function () { OSM.Browse = function (map, type) { const page = {}; - page.pushstate = page.popstate = function (path, id) { + page.pushstate = page.popstate = function (path, id, version) { OSM.loadSidebarContent(path, function () { - addObject(type, id); + addObject(type, id, version); }); }; - page.load = function (path, id) { - addObject(type, id, true); + page.load = function (path, id, version) { + addObject(type, id, version, true); }; - function addObject(type, id, center) { + function addObject(type, id, version, center) { const hashParams = OSM.parseHash(window.location.hash); - map.addObject({ type: type, id: parseInt(id, 10) }, function (bounds) { + map.addObject({ type: type, id: parseInt(id, 10), version: version && parseInt(version, 10) }, function (bounds) { if (!hashParams.center && bounds.isValid() && (center || !map.getBounds().contains(bounds))) { OSM.router.withoutMoveListener(function () { @@ -350,7 +350,7 @@ $(document).ready(function () { "/user/:display_name/history": history, "/note/:id": OSM.Note(map), "/node/:id(/history)": OSM.Browse(map, "node"), - "/node/:id/history/:version": OSM.OldBrowse(), + "/node/:id/history/:version": OSM.Browse(map, "node"), "/way/:id(/history)": OSM.Browse(map, "way"), "/way/:id/history/:version": OSM.OldBrowse(), "/relation/:id(/history)": OSM.Browse(map, "relation"),