]> git.openstreetmap.org Git - rails.git/commitdiff
Merge pull request #17 from danstowell/jsrouting-clearsearch
authorRichard Fairhurst <richard@systemeD.net>
Sun, 9 Mar 2014 17:35:51 +0000 (17:35 +0000)
committerRichard Fairhurst <richard@systemeD.net>
Sun, 9 Mar 2014 17:35:51 +0000 (17:35 +0000)
jsrouting: clear search boxes on page unload

app/assets/javascripts/router.js

index 9657549b1abdb893c304049b76ec894038a21402..05e47c3560955e4f8fb3fec90eb32d5cfc5f918e 100644 (file)
@@ -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;
 };