On Thu, Feb 16, 2012 at 11:45 AM, Gustaf Nilsson <[email protected]> wrote:
> Was just about to get on this, but looks like you already did it.
> So, tried the code in my app and the results are in:
>
> good news:
> Chrome and ffox now react in the same way.
>
> confusing news:
> when cursor enters B, b.onMouseEnter is called once. When leaving
> b.onMouseLeave is also called once - as expected.
>
> when entering and leaving A, a.onMouseEnter and a.onMouseLeave are
> both called twice (!?)

 hm try removing the if to_element test i added.

> G
>
> On Tue, Feb 14, 2012 at 8:19 PM, lkcl luke <[email protected]> wrote:
>> eyy good stuff!  someone kindly responded pretty much instantly, and i
>> noticed that we're using eventGetFromElement not eventGetToElement.
>>
>> gustav, can you try this, below, let me know how it goes?
>>
>> l.
>>
>> diff --git a/library/pyjamas/ui/MouseListener.py 
>> b/library/pyjamas/ui/MouseListe
>> index e2c8753..dc2f6e6 100644
>> --- a/library/pyjamas/ui/MouseListener.py
>> +++ b/library/pyjamas/ui/MouseListener.py
>> @@ -34,14 +34,14 @@ def fireMouseEvent(listeners, sender, event):
>>             listener.onMouseMove(sender, x, y)
>>         return True
>>     elif etype == "mouseover":
>> -        from_element = DOM.eventGetFromElement(event)
>> -        if not DOM.isOrHasChild(sender.getElement(), from_element):
>> +        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 not DOM.isOrHasChild(sender.getElement(), to_element):
>> +        if to_element and not DOM.isOrHasChild(sender.getElement(), 
>> to_element)
>>             for listener in listeners:
>>                 listener.onMouseLeave(sender)
>>         return True
>>
>>
>> On Tue, Feb 14, 2012 at 7:52 PM, lkcl luke <[email protected]> wrote:
>>> On Tue, Feb 14, 2012 at 4:58 PM, Gustaf Nilsson <[email protected]> 
>>> wrote:
>>>
>>>> http://code.google.com/p/pyjamas/issues/detail?id=682
>>>> badabing
>>>
>>>  *cackle*
>
>
>
> --
> ■ ■ ■ ■ ■ ■ ■ ■ ■ ■

Reply via email to