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");
$("#view_tab").removeClass("current");
};
- page.minimizeSidebar = function() {
- $("#sidebar").addClass("minimized");
- map.invalidateSize();
- minimized = true;
- };
-
- $(document).on("click", "#sidebar_content .close", page.minimizeSidebar);
-
return page;
};
$("#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();
};
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);
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({
<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>
%>
<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 %>
%>
<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| %>
<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>
%>
<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 %>
%>
<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| %>
@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 %>
%>
<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| %>
%>
<h2><%= @heading %>
- <span class="icon close"></span>
+ <a class="geolink" href="<%= root_path %>"><span class="icon close"></span></a>
</h2>
<div class="changesets">
<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>
<% 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'>
<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 %>
<% 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>