there's a bug in the following method (in listeners.js):

the corrected version is:

DynObject.prototype.addEventListener=function(listener) {
    if(!this.eventListeners) {
        this.eventListeners = [];
    }
    // the following line has been moved
    // it was inside the if-statement
    this.hasEventListeners = true;
    for (var i in this.eventListeners) if (this.eventListeners[i]==listener)
return;
    this.eventListeners[this.eventListeners.length]=listener;
}


the line:
   this.hasEventListeners = true;
has to be moved outside the if-statement.

otherwise the following happens: if you add some listeners and then remove
them all, this.hasEventListeners is set to false, but if you decide to again
add a listener, hasEventListeners would remain false, because eventListeners
is defined and the if-statement is not executed.

--
Michael Buerge


_______________________________________________
Dynapi-Dev mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-dev

Reply via email to