papasi
9 Mar 2007, 10:32 AM
fire : function(){
var ls = this.listeners, scope, len = ls.length;
if(len > 0){
this.firing = true;
var args = Array.prototype.slice.call(arguments, 0);
for(var i = 0; i < len; i++){
var l = ls[i];
if(l.fireFn.apply(l.scope, arguments) === false){
return false;
}
}
this.firing = false;
}
return true;
}
If one of the listerners return false, this.firing = true is not reset to false, is this ok?
Thanks
var ls = this.listeners, scope, len = ls.length;
if(len > 0){
this.firing = true;
var args = Array.prototype.slice.call(arguments, 0);
for(var i = 0; i < len; i++){
var l = ls[i];
if(l.fireFn.apply(l.scope, arguments) === false){
return false;
}
}
this.firing = false;
}
return true;
}
If one of the listerners return false, this.firing = true is not reset to false, is this ok?
Thanks