endpoints[1].setValue(params.get("to") || route[1] || "");
}
- const page = {};
-
- page.pushstate = page.popstate = function () {
- initializeFromParams();
-
- $(".search_form").hide();
- $(".directions_form").show();
-
+ function enableListeners() {
$("#map").on("dragend dragover", function (e) {
e.preventDefault();
});
endpoints[0].enableListeners();
endpoints[1].enableListeners();
+ }
+
+ const page = {};
+
+ page.pushstate = page.popstate = function () {
+ initializeFromParams();
+
+ $(".search_form").hide();
+ $(".directions_form").show();
+
+ enableListeners();
map.setSidebarOverlaid(!endpoints[0].latlng || !endpoints[1].latlng);
};