From fd991a0201c83a639c585de3119c779fda761209 Mon Sep 17 00:00:00 2001 From: Richard Fairhurst Date: Tue, 21 Jan 2014 21:15:49 +0000 Subject: [PATCH] Close directions --- app/assets/javascripts/index.js | 5 +++-- app/assets/javascripts/routing.js.erb | 10 +++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 638be0dca..a3531eb30 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -347,6 +347,8 @@ $(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(); $(".search").hide(); @@ -358,9 +360,8 @@ $(document).ready(function () { e.preventDefault(); $(".search").show(); $(".routing").hide(); + OSM.routing.close(); $(".query_wrapper.search [name=query]").focus(); }); - OSM.routing = OSM.Routing(map,'OSM.routing',$('.query_wrapper.routing')); - }); diff --git a/app/assets/javascripts/routing.js.erb b/app/assets/javascripts/routing.js.erb index ee76fb14f..ed9551252 100644 --- a/app/assets/javascripts/routing.js.erb +++ b/app/assets/javascripts/routing.js.erb @@ -10,6 +10,7 @@ *** click each part *** translation (including all alerts and presentation) *** export GPX + *** URL history (or do we consciously not want to support that?) */ var TURN_INSTRUCTIONS=["", @@ -96,7 +97,7 @@ OSM.Routing=function(map,name,jqSearch) { r.setItinerary=function(steps) { $("#content").removeClass("overlay-sidebar"); $('#sidebar_content').empty(); - var html='

Directions

'; + var html='

Directions

'.replace(/~/g,"'"); html+=""; for (var i=0; i