I've recently upgraded to jQuery 1.3.2 and the latest jQuery.UI.

 

As a part of this, one of my draggable scripts broke, and I want to make
sure it isn't due to a bad design on my own code before filling out a bug
report.

 

Here's what I'm trying to do:

 

1. I have a ul/li tree, with an image at the front of each li.

2. The entire list is set as a draggable (event delegation), with a drag
handle of img.class.

3. The drag start event looks at the event.target to determine which li is
being moved.

 

Now, after the upgrade, event.target is no longer the image, but is instead
set for the ul as a whole.

 

I stepped through the code with firebug, and the event is originally set
with the correct target, but it is overwritten as a part of the drag event
when the ui.core.js fires this method:

 

-----------------

 

_trigger: function(type, event, data) {

  ...

  this.element.trigger(event, data);

 

which goes to jquery.js:

 

trigger: function( event, data, elem ) {

  ...

  event.target = elem;   <-- target overwritten here

 

-----------------

 

Now, in jQuery 1.2.x, the trigger function only assigns the event.target if
a fake event is needed.  But in 1.3.x it ALWAYS assigns it.

 

So my question becomes:

 

1) Is my basic pattern above a good idea?  Event delegation for the
draggable?  What needs to be changed to make that work?

 

Or

 

2) Is this a bug that the event.target is being overwritten during a
trigger?

 

Thanks,

JK

 

 

 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to