]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index/history.js
Replace Vary header with explicit xhr=1 param
[rails.git] / app / assets / javascripts / index / history.js
index be62d37344d692b9797c749c6e55062e4fc69b36..29a3d1fb90a76bc59f0472f598433971dd845db4 100644 (file)
@@ -47,7 +47,7 @@ OSM.History = function(map) {
       url: window.location.pathname,
       method: "GET",
       data: {bbox: map.getBounds().toBBoxString()},
-      success: function(html) {
+      success: function(html, status, xhr) {
         $('#sidebar_content .changesets').html(html);
         updateMap();
       }
@@ -99,7 +99,12 @@ OSM.History = function(map) {
 
   page.pushstate = page.popstate = function(path) {
     $("#history_tab").addClass("current");
-    $("#sidebar_content").load(path, page.load);
+    $("#sidebar_content").load(path + "?xhr=1", function(a, b, xhr) {
+      if (xhr.getResponseHeader('X-Page-Title')) {
+        document.title = xhr.getResponseHeader('X-Page-Title');
+      }
+      page.load();
+    });
   };
 
   page.load = function() {