Sidebar work

This commit is contained in:
John Firebaugh 2013-09-27 18:02:50 -07:00
parent 6adcce4e5d
commit a01195f149
9 changed files with 12 additions and 38 deletions

View file

@ -10,10 +10,9 @@ $(document).ready(function () {
$("#search_form").submit(function (e) {
e.preventDefault();
$("#sidebar_title").html(I18n.t('site.sidebar.search_results'));
$("#sidebar_content").load($(this).attr("action"), {
query: $("#query").val()
}, openSidebar);
});
});
$("#describe_location").click(function (e) {
@ -21,11 +20,10 @@ $(document).ready(function () {
var mapParams = OSM.mapParams();
$("#sidebar_title").html(I18n.t('site.sidebar.search_results'));
$("#sidebar_content").load($(this).attr("href"), {
lat: mapParams.lat,
lon: mapParams.lon,
zoom: mapParams.zoom
}, openSidebar);
});
});
});

View file

@ -91,10 +91,6 @@ $(document).ready(function () {
map.dataLayer = new L.OSM.DataLayer(null);
map.dataLayer.options.code = 'D';
$("#sidebar").on("opened closed", function () {
map.invalidateSize();
});
var position = $('html').attr('dir') === 'rtl' ? 'topleft' : 'topright';
L.OSM.zoom({position: position})

View file

@ -63,11 +63,8 @@ function initializeBrowse(map, params) {
locationFilter.on("change", getData);
$("#sidebar_title").html(I18n.t('browse.start_rjs.data_frame_title'));
$("#sidebar_content").html(sidebarHtml);
openSidebar();
if (browseObjectList) loadObjectList();
map.on("moveend", updateData);

View file

@ -9,18 +9,16 @@ function initializeExport(map) {
adjustButton: false
}).addTo(map);
update();
locationFilter.on("change", update);
map.on("moveend", update);
$("#sidebar_title").html(I18n.t('export.start_rjs.export'));
$("#maxlat,#minlon,#maxlon,#minlat").change(boundsChanged);
$("#drag_box").click(enableFilter);
openSidebar();
setBounds(map.getBounds());
$("#sidebar").one("closed", function () {

View file

@ -21,7 +21,6 @@ function initializeSearch(map) {
var bounds = map.getBounds();
$("#sidebar_title").html(I18n.t('site.sidebar.search_results'));
$("#sidebar_content").load($(this).attr("action"), {
query: $("#query").val(),
zoom: map.getZoom(),
@ -31,8 +30,6 @@ function initializeSearch(map) {
maxlat: bounds.getNorth()
});
openSidebar();
$("#sidebar").one("closed", function () {
map.removeLayer(marker);
map.removeObject();
@ -67,11 +64,10 @@ function initializeSearch(map) {
var center = map.getCenter(),
zoom = map.getZoom();
$("#sidebar_title").html(I18n.t('site.sidebar.search_results'));
$("#sidebar_content").load($(this).attr("href"), {
lat: center.lat,
lon: center.lng,
zoom: zoom
}, openSidebar);
});
}
}

View file

@ -1,20 +1,6 @@
function openSidebar() {
$("#sidebar-main")
.hide();
$("#sidebar")
.trigger("closed")
.show()
.trigger("opened");
}
function closeSidebar() {
$("#sidebar")
.hide()
.trigger("closed");
$("#sidebar-main")
.show();
}
$(document).ready(function () {

View file

@ -1,3 +1,4 @@
<h2><%= t 'browse.start_rjs.data_frame_title' %></h2>
<div id="browse_controls" class='inner12'>
<a id="browse_filter_toggle" class="button" href="#"><%= t'browse.start_rjs.manually_select' %></a>
<a id="browse_hide_areas_box" class="button" href="#"><%= t'browse.start_rjs.hide_areas' %></a>

View file

@ -1,3 +1,4 @@
<h2><%= t('site.sidebar.search_results') %></h2>
<% @sources.each do |source| %>
<h4><%= raw(t "geocoder.search.title.#{source}") %></h4>
<div class="search_results_entry" id="<%= "search_#{source}" %>">

View file

@ -3,10 +3,11 @@
<% end %>
<% content_for :sidebar do %>
<h2><%= t 'export.start_rjs.export' %></h2>
<%= form_tag :controller => "export", :action => "finish" do %>
<%= hidden_field_tag 'format', 'osm' %>
<div class="export_bounds inner12">
<div class="export_bounds inner22">
<div class='export_area_inputs'>
<%= text_field_tag('maxlat', nil, :size => 10, :class => "export_bound") %>
<br/>
@ -21,14 +22,14 @@
<div id="export_osm">
<h4><%= t'export.start.licence' %></h4>
<div class="export_details inner12">
<div class="export_details">
<p><%= raw t'export.start.export_details' %></p>
</div>
<div id="export_osm_too_large">
<h4><%= t'export.start.too_large.heading' %></h4>
<div class="export_details inner12">
<div class="export_details">
<p><%= t'export.start.too_large.body' %></p>
<dl>
<dt><a href="http://planet.openstreetmap.org/"><%= t'export.start.too_large.planet.title' %></a></dt>
@ -47,7 +48,7 @@
</div>
</div>
<div class="inner12">
<div class="inner22">
<%= submit_tag t('export.start.export_button'), :id => "export_commit" %>
</div>
<% end %>