X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/ca64b39e0d204e76bc4a3a0281bdee9f22fe0824..68a3df4d53c84508bf443058040379c3a18eb1a7:/app/assets/javascripts/index.js?ds=sidebyside diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index f90dca7bf..3ce1a02da 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -42,10 +42,22 @@ clearTimeout(loaderTimeout); $('#flash').empty(); $('#sidebar_loader').hide(); - $('#sidebar_content').html(xhr.responseText); + + var content = $(xhr.responseText); + if (xhr.getResponseHeader('X-Page-Title')) { document.title = xhr.getResponseHeader('X-Page-Title'); } + + $('head') + .find('link[type="application/atom+xml"]') + .remove(); + + $('head') + .append(content.filter('link[type="application/atom+xml"]')); + + $('#sidebar_content').html(content.not('link[type="application/atom+xml"]')); + if (callback) { callback(); } @@ -249,13 +261,13 @@ $(document).ready(function () { "/": OSM.Index(map), "/search": OSM.Search(map), "/export": OSM.Export(map), - "/new_note": OSM.NewNote(map), + "/note/new": OSM.NewNote(map), + "/history/friends": history, + "/history/nearby": history, "/history": history, - "/user/:display_name/edits": history, - "/browse/friends": history, - "/browse/nearby": history, - "/browse/note/:id": OSM.Note(map), - "/browse/:type/:id(/history)": OSM.Browse(map) + "/user/:display_name/history": history, + "/note/:id": OSM.Note(map), + "/:type/:id(/history)": OSM.Browse(map) }); OSM.router.load();