//= require_self
//= require leaflet.sidebar
//= require leaflet.sidebar-pane
-//= require leaflet.locatecontrol/src/L.Control.Locate
+//= require leaflet.locatecontrol/dist/L.Control.Locate.umd
//= require leaflet.locate
//= require leaflet.layers
//= require leaflet.key
//= require qs/dist/qs
$(document).ready(function () {
- var loaderTimeout;
-
var map = new L.OSM.Map("map", {
zoomControl: false,
layerControl: false,
map.setSidebarOverlaid(false);
- clearTimeout(loaderTimeout);
-
- loaderTimeout = setTimeout(function () {
- $("#sidebar_loader").show();
- }, 200);
+ $("#sidebar_loader").show().addClass("delayed-fade-in");
// IE<10 doesn't respect Vary: X-Requested-With header, so
// prevent caching the XHR response as a full-page URL.
url: content_path,
dataType: "html",
complete: function (xhr) {
- clearTimeout(loaderTimeout);
$("#flash").empty();
- $("#sidebar_loader").hide();
+ $("#sidebar_loader").removeClass("delayed-fade-in").hide();
var content = $(xhr.responseText);
if (OSM.router.route(this.pathname + this.search + this.hash)) {
e.preventDefault();
+ if (this.pathname !== "/directions") {
+ $("header").addClass("closed");
+ }
}
});
}
}
+/* Utility for delayed loading spinner */
+
+.delayed-fade-in {
+ animation: 300ms linear forwards delayed-fade-in;
+}
+
+@keyframes delayed-fade-in {
+ 0% { opacity: 0 }
+ 66% { opacity: 0 }
+ 100% { opacity: 1 }
+}
+
/* Rules for the header */
#menu-icon {
}
nav.primary {
- & > .btn-group .btn-outline-primary {
+ #edit_tab .btn-outline-primary {
@include button-outline-variant($green, $color-hover: $white, $active-color: $white);
}
}
}
- #sidebar .search_forms,
- #edit_tab,
- #export_tab {
+ #sidebar .search_forms {
display: none;
}
margin-right: 0;
padding: 0;
- .btn-group {
+ #edit_tab {
width: 100%;
padding: 10px;
}
.leaflet-marker-draggable {
cursor: move;
}
+
+ .query-marker {
+ animation: 1500ms forwards query-marker-fade;
+
+ @keyframes query-marker-fade {
+ to { opacity: 0 }
+ }
+ }
}
#map-ui {