From: Richard Fairhurst Date: Sun, 9 Mar 2014 17:35:51 +0000 (+0000) Subject: Merge pull request #17 from danstowell/jsrouting-clearsearch X-Git-Tag: live~4781^2~20 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/373b932717a16e4d3aebf807739b39e4db2f83e1?hp=42c1dec8f0f53b457e9512bcc24f26cad9df9916 Merge pull request #17 from danstowell/jsrouting-clearsearch jsrouting: clear search boxes on page unload --- diff --git a/app/assets/javascripts/router.js b/app/assets/javascripts/router.js index 9657549b1..05e47c356 100644 --- a/app/assets/javascripts/router.js +++ b/app/assets/javascripts/router.js @@ -174,6 +174,9 @@ OSM.Router = function(map, rts) { map.on('moveend baselayerchange overlaylayerchange', router.updateHash); $(window).on('hashchange', router.hashUpdated); + $(window).on('unload', function(e) { + $(".query_wrapper.routing input").val(""); + }); return router; };