]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/site/index.html.erb
Always update perma and shortlinks, keeping layers
[rails.git] / app / views / site / index.html.erb
index d378a6ff76a3fa68bd48d7f5377a87e01e47c1e7..86eed75566eb2a55ab3d2c6d09c2a670d5b995a1 100644 (file)
@@ -1,7 +1,7 @@
-<% content_for :greeting do %>
 <% if @user and !@user.home_lon.nil? and !@user.home_lat.nil? %>
-  <%= link_to_function t('layouts.home'), "setPosition(#{@user.home_lat}, #{@user.home_lon}, 15)", { :title => t('layouts.home_tooltip') } %> |
-<% end %>
+  <% content_for :greeting do %>
+    <%= link_to_function t('layouts.home'), "setPosition(#{@user.home_lat}, #{@user.home_lon}, 15)", { :title => t('layouts.home_tooltip') } %> |
+  <% end %>
 <% end %>
 
 <%= render :partial => 'sidebar', :locals => { :onopen => "resizeMap();", :onclose => "resizeMap();" } %>
@@ -160,8 +160,6 @@ end
 
         setMapCenter(centre, zoom);
       <% end %>
-
-      updateLocation();
     <% end %>
 
     <% if !layers.nil? and !layers.empty? %>
@@ -185,6 +183,7 @@ end
     map.events.register("moveend", map, updateLocation);
     map.events.register("changelayer", map, updateLocation);
 
+    updateLocation();
     handleResize();
   }
 
@@ -280,7 +279,15 @@ end
     map.setCenter(centre, zoom);
   });
 
-  <% if params[:action] == 'export' %>
-  <%= remote_function :url => { :controller => 'export', :action => 'start' } %>
-  <% end %>
+  document.observe("dom:loaded", function () {
+    $("exportanchor").observe("click", function (e) {
+      <%= remote_function :url => { :controller => 'export', :action => 'start' } %>;
+      Event.stop(e);
+    });
+
+    <% if params[:action] == 'export' %>
+    <%= remote_function :url => { :controller => 'export', :action => 'start' } %>;
+    <% end %>
+  });
+// -->
 </script>