]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index/history.js
Rewrite bbox only in place history atom links
[rails.git] / app / assets / javascripts / index / history.js
index c20d342c5c3bafcdbfab633cd6160386de428fd2..d137b84565f1ad74755b8ed269c8d737d5c71dd3 100644 (file)
@@ -48,6 +48,9 @@ OSM.History = function (map) {
 
     if (window.location.pathname === "/history") {
       data.bbox = map.getBounds().wrap().toBBoxString();
+      var feedLink = $("link[type=\"application/atom+xml\"]"),
+          feedHref = feedLink.attr("href").split("?")[0];
+      feedLink.attr("href", feedHref + "?bbox=" + data.bbox);
     }
 
     $.ajax({
@@ -59,11 +62,6 @@ OSM.History = function (map) {
         updateMap();
       }
     });
-
-    var feedLink = $("link[type=\"application/atom+xml\"]"),
-        feedHref = feedLink.attr("href").split("?")[0];
-
-    feedLink.attr("href", feedHref + "?bbox=" + data.bbox);
   }
 
   function loadMore(e) {