From 69aca22e6a03fbe43327f08e4d9db26e81434d70 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Thu, 5 Dec 2013 12:11:57 -0800 Subject: [PATCH] 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 --- app/assets/javascripts/router.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.39.5