diff --git a/WebContent/OSRM.EventHandler.js b/WebContent/OSRM.EventHandler.js index 6e0264ac2..a43033505 100644 --- a/WebContent/OSRM.EventHandler.js +++ b/WebContent/OSRM.EventHandler.js @@ -27,14 +27,14 @@ OSRM.extend( OSRM.EventHandler, { // add listener addListener: function(type, listener) { - if( typeof this._listeners[type] == "undefined" ) + if( this._listeners[type] == undefined) this._listeners[type] = []; this._listeners[type].push(listener); }, //remove event listener removeListener: function(type, listener) { - if( this._listeners[type] instanceof Array) { + if( this._listeners[type] != undefined) { for(var i=0; i