From 223d5fd13245308eaf0ee92e8f946aab078f4850 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Fri, 29 Nov 2013 00:05:25 +0000 Subject: [PATCH 1/1] Stop browse routes matching user URLs --- app/assets/javascripts/index.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 3ce1a02da..7c7cf7906 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -235,16 +235,16 @@ $(document).ready(function () { return page; }; - OSM.Browse = function(map) { + OSM.Browse = function(map, type) { var page = {}; - page.pushstate = page.popstate = function(path, type, id) { + page.pushstate = page.popstate = function(path, id) { OSM.loadSidebarContent(path, function() { page.load(path, type, id); }); }; - page.load = function(path, type, id) { + page.load = function(path, id) { map.addObject({type: type, id: parseInt(id)}); }; @@ -266,8 +266,11 @@ $(document).ready(function () { "/history/nearby": history, "/history": history, "/user/:display_name/history": history, - "/note/:id": OSM.Note(map), - "/:type/:id(/history)": OSM.Browse(map) + "/note/:id": OSM.Note(map), + "/node/:id(/history)": OSM.Browse(map, 'node'), + "/way/:id(/history)": OSM.Browse(map, 'way'), + "/relation/:id(/history)": OSM.Browse(map, 'relation'), + "/changeset/:id": OSM.Browse(map, 'changeset') }); OSM.router.load(); -- 2.43.2