fix(events): fixing IE specific issues

IE doesn't have Array#indexOf and [].splice.call doesn't work there
either.
This commit is contained in:
Igor Minar
2011-08-24 18:36:35 -07:00
parent 19401280ae
commit 452607fc64
2 changed files with 5 additions and 4 deletions

View File

@@ -569,10 +569,11 @@ Scope.prototype = {
* @param {function} listener Function to remove.
*/
$removeListener: function(name, listener) {
var namedListeners = this.$$listeners[name];
var i;
var namedListeners = this.$$listeners[name],
i;
if (namedListeners) {
i = namedListeners.indexOf(listener);
i = indexOf(namedListeners, listener);
namedListeners.splice(i, 1);
}
},