eve icon indicating copy to clipboard operation
eve copied to clipboard

Event is overwritten when Element.attr() is called in a handler (Raphael)

Open xzed opened this issue 14 years ago • 0 comments

I fire an Event with Eve:

eve("test.a");

if I have an Eve EventHandler in which Element.attr() is called:

eve.on("test.*",function(){
   console.log('#1',evt.nt());

   circle.attr('r',20);  // circle is defined somewhere else

   console.log('#2',evt.nt());
});

in the console:

 #1, "test.a"
 #2, "attr..."

the original Eventname is overwritten.

I found in the source code of Raphael, that when caling elproto.attr(), a new Event is fired, which is the cause for this bug.

The problem is now, if you have a second EventHandler which also listens for "test.*",

and you want to elaborate inside which subname the Event has, you can't do this.

The original Problem may be in Eve..

if a Event is fired inside a Handler the original Event seems to be overwritten

I would be thankful for any respond / solution.

xzed avatar Jan 26 '12 17:01 xzed