]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index.js
Start work on drag-and-drop start/end markers
[rails.git] / app / assets / javascripts / index.js
index 7369c0fb4c928fb3186570fea2df931a7fc03ccf..f3df5ae676955a1925eeedaeabf4a4c541e47cd5 100644 (file)
@@ -356,6 +356,8 @@ $(document).ready(function () {
        $(".search").hide();
        $(".routing").show();
        $(".query_wrapper.routing [name=route_from]").focus();
+       $("#map").on('dragend dragover',function(e) { e.preventDefault(); });
+       $("#map").on('drop',function(e) { OSM.routing.handleDrop(e); });
   });
 
   $(".close_directions").on("click",function(e) {
@@ -363,6 +365,7 @@ $(document).ready(function () {
        $(".search").show();
        $(".routing").hide();
        OSM.routing.close();
+       $("#map").off('dragend drop dragover');
        $(".query_wrapper.search [name=query]").focus();
   });