]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/site/edit.rhtml
Split out sidebar code from the search code so it can be reused for the
[rails.git] / app / views / site / edit.rhtml
index 6b5952f3856d32ca3a93294b0d85535e6d5c5843..ceb4702d43808345da7a8bb18b5103f6d073af28 100644 (file)
@@ -13,7 +13,8 @@
 <% end %>
 <% end %>
 
-<%= render :partial => 'search', :locals => { :onopen => "resizeMap();", :onclose => "resizeMap();" } %>
+<%= render :partial => 'sidebar', :locals => { :onopen => "resizeMap();", :onclose => "resizeMap();" } %>
+<%= render :partial => 'search' %>
 
 <% session[:token] = @user.tokens.create.token unless session[:token] %>
 
   }
   
   function resizeMap() {
-    var search_results_width = $("search_results").offsetWidth;
+    var sidebar_width = $("sidebar").offsetWidth;
 
-    if (search_results_width > 0) {
-      search_results_width = search_results_width + 5
+    if (sidebar_width > 0) {
+      sidebar_width = sidebar_width + 5
     }
 
-    $("map").style.left = (search_results_width) + "px";
-    $("map").style.width = ($("content").offsetWidth - search_results_width) + "px";
+    $("map").style.left = (sidebar_width) + "px";
+    $("map").style.width = ($("content").offsetWidth - sidebar_width) + "px";
     $("map").style.height = ($("content").offsetHeight - 2) + "px";
   }