drag and drop reset

0 views
Skip to first unread message

Tim Wisniewski

unread,
Sep 28, 2007, 9:39:47 AM9/28/07
to Ruby on Rails: Spinoffs
I have a draggable, and I place it on a droppable. How do I make the
draggable go back to its original postion? Thanks.

-Tim

Matt Foster

unread,
Sep 28, 2007, 2:55:17 PM9/28/07
to Ruby on Rails: Spinoffs
If you dig into the guts of the Draggable class, you'll see that a
Draggable never removes the element from its parent, just effects its
position properties to move it inside the document. To get the item
such that its like cloning the object into a cart or something, use
the "onEnd" event to make a clone, stuff the clone where you want and
just reset the position properties of the original and it will fall
back into place. Which is really a hack of the class, i think this
sort of functionality is so common that it should be more
appropriately accommodated.

Cheers,
Matt

Reply all
Reply to author
Forward
0 new messages