X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/6670de16a1981144869d7132e0bcc94a3b804513..873c1cb84e2fe475bc4ff566d71929fdcc35787d:/app/assets/javascripts/router.js?ds=inline diff --git a/app/assets/javascripts/router.js b/app/assets/javascripts/router.js index 2f76f2f18..05e47c356 100644 --- a/app/assets/javascripts/router.js +++ b/app/assets/javascripts/router.js @@ -113,8 +113,8 @@ OSM.Router = function(map, rts) { var path = url.replace(/#.*/, ''), route = routes.recognize(path); if (!route) return false; - window.history.pushState(OSM.parseHash(url), document.title, url); currentRoute.run('unload'); + window.history.pushState(OSM.parseHash(url), document.title, url); currentPath = path; currentRoute = route; currentRoute.run('pushstate', currentPath); @@ -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; };