Unconditionally unbind moveend event
Can't rely on checking location.pathname -- inside unload, it already contains the new path. Fortunately, checking is unnecessary. Fixes TypeError: Cannot call method 'split' of undefined.
This commit is contained in:
parent
9544ab12b8
commit
bdbc1d663d
1 changed files with 1 additions and 4 deletions
|
@ -134,10 +134,7 @@ OSM.History = function(map) {
|
||||||
|
|
||||||
page.unload = function() {
|
page.unload = function() {
|
||||||
map.removeLayer(group);
|
map.removeLayer(group);
|
||||||
|
map.off("moveend", update);
|
||||||
if (window.location.pathname === '/history') {
|
|
||||||
map.off("moveend", update)
|
|
||||||
}
|
|
||||||
|
|
||||||
$("#history_tab").removeClass("current");
|
$("#history_tab").removeClass("current");
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue