My comment about this._hasMouseEvents is below:

> ---- Original Message -----
> From: Benoit Marchant
>
> a side note, is it necessary to call captureMouseEvents() on a dynlayer that has no 
> listener ?
> in DynLayer._assignElement, there's a test I don't understand:
> if (dlyr._hasMouseEvents) dlyr.captureMouseEvents();
> and captureMouseEvents is the only place where this._hasMouseEvents is set to true; 
> ????
> Feedback ?
> Benoit

No.

In file:
event.js:
method addEventListener

if (this.captureMouseEvents) {
   if (this._created && !this._hasMouseEvents && (el.onmousedown || el.onmouseup || 
el.onmouseover
|| el.onmouseout || el.onclick || el.ondblclick)) {
    this.captureMouseEvents();
   }
   else this._hasMouseEvents = true;
}

If the element hasn't been rendered (!this._created) no event listener can be attached
(captureMouseEvents)
so (else) this._hasMouseEvents = true; and incorrect. I think this is a bug as some 
examples
addEventListener
before rendering (onload).

I'm developing keyevents and not adding a similar condition  'else this._hasKeyEvents 
= true;' to
event.js but testing
for if(!elm||this._hasKeyEvents) in captureKeyEvents() in ext/dynkeyevent.js then if I 
do an
elm.addEventListener
I'll set this._hasKeyEvents=true; in one place only!

This is not in cvs yet - but an idea for mouse events aswell.

Kevin.







-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Dynapi-Dev mailing list
[EMAIL PROTECTED]
http://www.mail-archive.com/[EMAIL PROTECTED]/

Reply via email to