From: John Firebaugh Date: Thu, 5 Dec 2013 20:11:57 +0000 (-0800) Subject: Run unload method before pushing the new state X-Git-Tag: live~5153 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/69aca22e6a03fbe43327f08e4d9db26e81434d70 Run unload method before pushing the new state If running unload causes any hash changes, those should not end up on the new URL. Fixes #622 --- diff --git a/app/assets/javascripts/router.js b/app/assets/javascripts/router.js index 2f76f2f18..9657549b1 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);