]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index/directions.js
Install endpoint listeners using enable/disable methods
[rails.git] / app / assets / javascripts / index / directions.js
index 3f78c708945147f08df780715d320c66a56a8625..e0463ef8de00d4306fa0f3c53069a8bbef9f322d 100644 (file)
@@ -289,6 +289,9 @@ OSM.Directions = function (map) {
       endpoints[type === "from" ? 0 : 1].setValue(value, ll);
     });
 
+    endpoints[0].enable();
+    endpoints[1].enable();
+
     var params = Qs.parse(location.search.substring(1)),
         route = (params.route || "").split(";"),
         from = route[0] && L.latLng(route[0].split(",")),
@@ -317,6 +320,9 @@ OSM.Directions = function (map) {
     $(".directions_form").hide();
     $("#map").off("dragend dragover drop");
 
+    endpoints[0].disable();
+    endpoints[1].disable();
+
     map
       .removeLayer(popup)
       .removeLayer(polyline)