d.lat.toFixed(precision) + ',' + d.lng.toFixed(precision)
}));
- $(".directions_form .spinner").show();
+ // copy loading item to sidebar and display it. we copy it, rather than
+ // just using it in-place and replacing it in case it has to be used
+ // again.
+ $('#sidebar_content').html($('.directions_form .loader_copy').html());
awaitingRoute = true;
+ map.setSidebarOverlaid(false);
chosenEngine.getRoute([o, d], function (err, route) {
awaitingRoute = false;
- $(".directions_form .spinner").hide();
-
if (err) {
map.removeLayer(polyline);
.setLatLngs(route.line)
.addTo(map);
- map.setSidebarOverlaid(false);
-
if (!dragging) {
map.fitBounds(polyline.getBounds().pad(0.05));
}
</div>
<select class='routing_engines' name='routing_engines'></select>
<div width="100%" align="right"><%= submit_tag t('site.search.submit_text') %></div>
- <%= image_tag "searching-small.gif", :class => 'spinner', :style => "vertical-align: middle; display: none;" %>
+ <div class="loader_copy" style="display:none;"><div class="loader"><%= image_tag "searching.gif", :style => "vertical-align: middle;" %></div></div>
</form>
</div>