X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/fd991a0201c83a639c585de3119c779fda761209..15c156483263893d2c767030bd544d589833af93:/app/assets/javascripts/routing.js.erb diff --git a/app/assets/javascripts/routing.js.erb b/app/assets/javascripts/routing.js.erb index ed9551252..f496262d2 100644 --- a/app/assets/javascripts/routing.js.erb +++ b/app/assets/javascripts/routing.js.erb @@ -95,10 +95,13 @@ OSM.Routing=function(map,name,jqSearch) { // (we use OSRM's route_instructions format) // *** translations? r.setItinerary=function(steps) { + // Create base table $("#content").removeClass("overlay-sidebar"); $('#sidebar_content').empty(); var html='

Directions

'.replace(/~/g,"'"); - html+=""; + html+="
"; + $('#sidebar_content').html(html); + // Add each row for (var i=0; i "; - html+=""); + row.append("
"+instText; - html+=""+dist; + var row=$("
"); + row.append(""+instText); + row.append(""+dist); + with ({n: i}) { row.on('click',function(e) { r.clickTurn(n); }); + } + $('#turnbyturn').append(row); } - html+="
"; - $('#sidebar_content').html(html); + }; + r.clickTurn=function(num) { + console.log("clicked turn",num); };