]> git.openstreetmap.org Git - rails.git/commitdiff
jsrouting: clear search boxes on page unload
authorDan Stowell <danstowell@users.sourceforge.net>
Sun, 9 Mar 2014 15:06:08 +0000 (15:06 +0000)
committerDan Stowell <danstowell@users.sourceforge.net>
Sun, 9 Mar 2014 15:06:08 +0000 (15:06 +0000)
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;
 };