From bdbc1d663d04075f45a87a4b78b0744a008d758c Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Tue, 3 Dec 2013 15:04:24 -0800 Subject: [PATCH 1/1] 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. --- app/assets/javascripts/index/history.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/assets/javascripts/index/history.js b/app/assets/javascripts/index/history.js index dfec793f6..d98179d8a 100644 --- a/app/assets/javascripts/index/history.js +++ b/app/assets/javascripts/index/history.js @@ -134,10 +134,7 @@ OSM.History = function(map) { page.unload = function() { map.removeLayer(group); - - if (window.location.pathname === '/history') { - map.off("moveend", update) - } + map.off("moveend", update); $("#history_tab").removeClass("current"); }; -- 2.45.2