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(/#.*/, ''),
|
||||
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue