> now HTML5's / DOM3 Events') mouseenter and mouseleave events:
http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/...
thomas, hi, thanks for pointing this out. what we had was using
DOM.eventGetFromElement for mouseover, whereas the code in GWT uses
eventGetToElement.
i've modified the equivalent pyjamas code to this:
elif etype == "mouseover":
to_element = DOM.eventGetToElement(event)
if to_element and not DOM.isOrHasChild(sender.getElement(),
to_element):
for listener in listeners:
listener.onMouseEnter(sender)
return True
elif etype == "mouseout":
to_element = DOM.eventGetToElement(event)
if to_element and not DOM.isOrHasChild(sender.getElement(),
to_element):
for listener in listeners:
listener.onMouseLeave(sender)
return True
return False
where it is this in java:
public void onBrowserEvent(Event event) {
switch (DOM.eventGetType(event)) {
case Event.ONMOUSEOVER:
// Only fire the mouse over event if it's coming from outside
this
// widget.
case Event.ONMOUSEOUT:
// Only fire the mouse out event if it's leaving this
// widget.
Element related = event.getRelatedEventTarget().cast();
if (related != null && getElement().isOrHasChild(related)) {
return;
}
break;
}
DomEvent.fireNativeEvent(event, this, this.getElement());
}