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
This commit is contained in:
parent
21407ede7e
commit
69aca22e6a
1 changed files with 1 additions and 1 deletions
|
@ -113,8 +113,8 @@ OSM.Router = function(map, rts) {
|
||||||
var path = url.replace(/#.*/, ''),
|
var path = url.replace(/#.*/, ''),
|
||||||
route = routes.recognize(path);
|
route = routes.recognize(path);
|
||||||
if (!route) return false;
|
if (!route) return false;
|
||||||
window.history.pushState(OSM.parseHash(url), document.title, url);
|
|
||||||
currentRoute.run('unload');
|
currentRoute.run('unload');
|
||||||
|
window.history.pushState(OSM.parseHash(url), document.title, url);
|
||||||
currentPath = path;
|
currentPath = path;
|
||||||
currentRoute = route;
|
currentRoute = route;
|
||||||
currentRoute.run('pushstate', currentPath);
|
currentRoute.run('pushstate', currentPath);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue