Sidebar close reverts to 'view' state
This commit is contained in:
parent
774aa0c875
commit
e7d200c4a6
17 changed files with 19 additions and 25 deletions
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
|
@ -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();
|
||||
};
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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({
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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 %>
|
||||
|
|
|
@ -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| %>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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 %>
|
||||
|
|
|
@ -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| %>
|
||||
|
|
|
@ -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 %>
|
||||
|
|
|
@ -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| %>
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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'>
|
||||
|
|
|
@ -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 %>
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue