]> git.openstreetmap.org Git - rails.git/commitdiff
Sidebar close reverts to 'view' state
authorAaron Lidman <aaronlidman@gmail.com>
Thu, 7 Nov 2013 00:59:14 +0000 (16:59 -0800)
committerAaron Lidman <aaronlidman@gmail.com>
Thu, 7 Nov 2013 00:59:14 +0000 (16:59 -0800)
17 files changed:
app/assets/javascripts/index.js
app/assets/javascripts/index/export.js
app/assets/javascripts/index/history.js
app/assets/javascripts/index/search.js
app/views/browse/changeset.html.erb
app/views/browse/node.html.erb
app/views/browse/node_history.html.erb
app/views/browse/note.html.erb
app/views/browse/relation.html.erb
app/views/browse/relation_history.html.erb
app/views/browse/way.html.erb
app/views/browse/way_history.html.erb
app/views/changeset/history.html.erb
app/views/geocoder/search.html.erb
app/views/layouts/map.html.erb
app/views/site/export.html.erb
app/views/site/index.html.erb

index d1adaeff387de1cb69d04b25d39eba3304e08e00..238ab7f6398e81af3e6cd583601b533dc39ac159 100644 (file)
@@ -231,7 +231,7 @@ $(document).ready(function () {
   initializeNotes(map);
 
   OSM.Index = function(map) {
-    var page = {}, minimized = false;
+    var page = {}, minimized = $('#sidebar').hasClass('minimized');
 
     page.pushstate = page.popstate = function(path) {
       if (minimized) $("#sidebar").addClass("minimized");
@@ -244,14 +244,6 @@ $(document).ready(function () {
       $("#view_tab").removeClass("current");
     };
 
-    page.minimizeSidebar = function() {
-      $("#sidebar").addClass("minimized");
-      map.invalidateSize();
-      minimized = true;
-    };
-
-    $(document).on("click", "#sidebar_content .close", page.minimizeSidebar);
-
     return page;
   };
 
index 02dcdd4402eb2676db62c1132f197dd33c0ecf33..23c50323647a16313da162971dd4410215ff82b4 100644 (file)
@@ -52,16 +52,18 @@ OSM.Export = function(map) {
     $("#export_tab").addClass("current");
     $("#sidebar").removeClass("minimized");
     map.invalidateSize();
-    $('#sidebar_content').load(path, page.load);
+    $("#sidebar_content").load(path, page.load);
   };
 
   page.load = function() {
+    $("#sidebar").removeClass("minimized");
     map
       .addLayer(locationFilter)
       .on("moveend", update);
 
     $("#maxlat, #minlon, #maxlon, #minlat").change(boundsChanged);
     $("#drag_box").click(enableFilter);
+    $("#sidebar_content .close").on("click", page.minimizeSidebar);
 
     update();
   };
index ed4e2b41734bce73248e74dbe6bf255ba54af0b7..d27a069439233748cefee2a2b580c100c4f5f5e7 100644 (file)
@@ -99,12 +99,12 @@ OSM.History = function(map) {
 
   page.pushstate = page.popstate = function(path) {
     $("#history_tab").addClass("current");
-    $("#sidebar").removeClass("minimized");
     map.invalidateSize();
     $("#sidebar_content").load(path, page.load);
   };
 
   page.load = function() {
+    $("#sidebar").removeClass("minimized");
     map
       .on("moveend", loadData)
       .addLayer(group);
index b9e86a4c312b45cbc1f8b85f53bad8e72c054235..434135df50c21353489a4d289c8f0ef26c9299c9 100644 (file)
@@ -49,12 +49,12 @@ OSM.Search = function(map) {
   page.pushstate = page.popstate = function(path) {
     var params = querystring.parse(path.substring(path.indexOf('?') + 1));
     $("#query").val(params.query);
-    $("#sidebar").removeClass("minimized");
     map.invalidateSize();
     $("#sidebar_content").load(path, page.load);
   };
 
   page.load = function() {
+    $("#sidebar").removeClass("minimized");
     $(".search_results_entry").each(function() {
       var entry = $(this);
       $.ajax({
index b9b37da47108cb2205685423f7cb60bab0021249..0d64ffae62e07cface5b51821c7f3510471f8865 100644 (file)
@@ -1,5 +1,5 @@
 <h2><%= t 'browse.changeset.changeset', :id => @changeset.id %>
-  <span class="icon close"></span>
+  <a class="geolink" href="<%= root_path %>"><span class="icon close"></span></a>
 </h2>
 <div class="browse-section">
   <p>
index c43c154687b09de5a2c9171b86ae57e99ef1e904..8302f472d0cfd478bf723bacfd9cc461c046d767 100644 (file)
@@ -4,7 +4,7 @@
 %>
 
 <h2><%= t'browse.node.node_title', :node_name => @name %>
-    <span class="icon close"></span>
+    <a class="geolink" href="<%= root_path %>"><span class="icon close"></span></a>
 </h2>
 
 <%= render :partial => "node_details", :object => @node %>
index 0ae5a36e8e4ef0634a3d0be87293e4a8149b016f..cbf7853f2e2610655e4f63440605c6dbcb14d29f 100644 (file)
@@ -4,7 +4,7 @@
 %>
 
 <h2><%= raw t'browse.node_history.node_history_title', :node_name => link_to(h(@name), :action => "node", :id => @node.id) %>
-    <span class="icon close"></span>
+    <a class="geolink" href="<%= root_path %>"><span class="icon close"></span></a>
 </h2>
 
 <% @node.old_nodes.reverse.each do |node| %>
index c91005b602d1e8d560e52f5055dfb0c8b8790421..061a86b067c220ac2a3dffa37396fdc98c42db94 100644 (file)
@@ -1,5 +1,5 @@
 <h2><%= t "browse.note.#{@note.status}_title", :note_name => @note.id %>
-  <span class="icon close"></span>
+  <a class="geolink" href="<%= root_path %>"><span class="icon close"></span></a>
 </h2>
 <div class="browse-section">
   <span>
index 8472981998cb92b59fd9678830fe8789c53504dd..2db0d0f44bd3f7ef613d282c38bcc45e90648a63 100644 (file)
@@ -4,7 +4,7 @@
 %>
 
 <h2><%= t'browse.relation.relation_title', :relation_name => @name %>
-    <span class="icon close"></span>
+    <a class="geolink" href="<%= root_path %>"><span class="icon close"></span></a>
 </h2>
 
 <%= render :partial => "relation_details", :object => @relation %>
index 32eb2f400199fecffe388d5354312eb9c66bb370..653991b9d2affb8a6ef21419c112e17aab8d9dab 100644 (file)
@@ -4,7 +4,7 @@
 %>
 
 <h2><%= raw t'browse.relation_history.relation_history_title', :relation_name => link_to(h(@name), :action => "relation", :id => @relation.id) %>
-    <span class="icon close"></span>
+    <a class="geolink" href="<%= root_path %>"><span class="icon close"></span></a>
 </h2>
 
 <% @relation.old_relations.reverse.each do |relation| %>
index 4dacaf929fda4e68ba65ddf912ab584b925aa380..5b33bd49e829baef8715959001bc804395d32ebb 100644 (file)
@@ -3,7 +3,7 @@
 @title = t('browse.way.way') + ' | ' + @name
 %>
 <h2><%= t'browse.way.way_title', :way_name => @name %>
-    <span class="icon close"></span>
+    <a class="geolink" href="<%= root_path %>"><span class="icon close"></span></a>
 </h2>
 
 <%= render :partial => "way_details", :object => @way %>
index 34cfb20ad4f0119a2fb4f271ccfdc38a7ec368a5..8959a3fd4b1a8a565a99e13b6d48ffca0c8631e5 100644 (file)
@@ -4,7 +4,7 @@
 %>
 
 <h2><%= raw t'browse.way_history.way_history_title', :way_name => link_to(h(@name), :action => "way", :id => @way.id) %>
-    <span class="icon close"></span>
+    <a class="geolink" href="<%= root_path %>"><span class="icon close"></span></a>
 </h2>
 
 <% @way.old_ways.reverse.each do |way| %>
index 03af11ec193429895cc7119aeeb93b639d851d10..e5cb104e95b8fa7ff931d011170a1f8838858434 100644 (file)
@@ -21,7 +21,7 @@
 %>
 
 <h2><%= @heading %>
-  <span class="icon close"></span>
+  <a class="geolink" href="<%= root_path %>"><span class="icon close"></span></a>
 </h2>
 
 <div class="changesets">
index e142d00b8964943c357fce9b3928697bd99e92aa..e3f8459390ac3061874bc34d65db7334673def71 100644 (file)
@@ -1,6 +1,6 @@
 <h2>
        <%= t('site.sidebar.search_results') %>
-       <span class="icon close"></span>
+    <a class="geolink" href="<%= root_path %>"><span class="icon close"></span></a>
 </h2>
 <% @sources.each do |source| %>
   <h4 class="inner12"><%= raw(t "geocoder.search.title.#{source}") %></h4>
index c6467382a4d6ae3d87ad4a11b4d5f58d912f4065..40aaae186523895a891cbd46e36b442506bffcaa 100644 (file)
@@ -17,7 +17,7 @@
 <% end %>
 
 <% content_for :content do %>
-  <div id="sidebar">
+  <div id="sidebar" class="<%= 'minimized' if @user %>">
     <%= form_tag search_path, :id => "search_form" do %>
       <%= submit_tag t('site.search.submit_text') %>
       <div id='query_wrapper'>
index ed94aff02472f266e676cf2334e16752e540afc6..f071c0b4329f689432a7962ae3dca3c93bb09a79 100644 (file)
@@ -1,5 +1,5 @@
 <h2><%= t 'export.start_rjs.export' %>
-  <span class="icon close"></span>
+  <a class="geolink" href="<%= root_path %>"><span class="icon close"></span></a>
 </h2>
 
 <%= form_tag :controller => "export", :action => "finish" do %>
index 3eba3e6d540125859f82e6f9d27d8608cc2ce9d1..37992585d3270496c114e70889c432dd8d822df4 100644 (file)
@@ -2,7 +2,7 @@
   <% if !@user %>
     <%= t 'layouts.intro_header' %>
   <% else %>
-    <span class="icon close"></span>
+    <a class="geolink" href="<%= root_path %>"><span class="icon close"></span></a>
   <% end %>
 </h2>