]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index.js
Start to make turn-by-turn instructions clickable
[rails.git] / app / assets / javascripts / index.js
index 74ec0582395818762d48a7390854d3ba306297ab..a3531eb3060c710eeeb9b36fc40c2dc3cc7e1901 100644 (file)
@@ -347,20 +347,21 @@ $(document).ready(function () {
       map.getCenter().lng.toFixed(precision)));
   });
 
+  OSM.routing = OSM.Routing(map,'OSM.routing',$('.query_wrapper.routing'));
+
   $(".get_directions").on("click",function(e) {
        e.preventDefault();
-       $(".query_wrapper.search").hide();
-       $(".query_wrapper.routing").show();
+       $(".search").hide();
+       $(".routing").show();
        $(".query_wrapper.routing [name=route_from]").focus();
   });
 
   $(".close_directions").on("click",function(e) {
        e.preventDefault();
-       $(".query_wrapper.search").show();
-       $(".query_wrapper.routing").hide();
+       $(".search").show();
+       $(".routing").hide();
+       OSM.routing.close();
        $(".query_wrapper.search [name=query]").focus();
   });
 
-  OSM.routing = OSM.Routing(map,'OSM.routing',$('.query_wrapper.routing'));
-
 });