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:
John Firebaugh 2013-12-03 15:04:24 -08:00 committed by Tom Hughes
parent 9544ab12b8
commit bdbc1d663d

View file

@ -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");
}; };