From 56b2fdf5c9915b02c8bf051e4f82927ae72c8c41 Mon Sep 17 00:00:00 2001 From: Matt Amos Date: Mon, 26 Jan 2015 15:39:53 +0000 Subject: [PATCH] Hide route steps sidebar when user presses close button. --- app/assets/javascripts/index/directions.js.erb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/assets/javascripts/index/directions.js.erb b/app/assets/javascripts/index/directions.js.erb index ee2cce667..3e2251b7a 100644 --- a/app/assets/javascripts/index/directions.js.erb +++ b/app/assets/javascripts/index/directions.js.erb @@ -253,6 +253,14 @@ OSM.Directions = function (map) { $('#sidebar_content').append('

' + I18n.t('javascripts.directions.instructions.courtesy', {link: chosenEngine.creditline}) + '

'); + + $('#sidebar_content a.geolink').on('click', function(e) { + e.preventDefault(); + map.removeLayer(polyline); + $('#sidebar_content').html(''); + map.setSidebarOverlaid(true); + // TODO: collapse width of sidebar back to previous + }); }); } -- 2.39.5