yui/yui3 — pull request #129 by benediktarnold (2012-05-07 16:21:26+00:00)
Title: fixed missing call to DD.Drop.destroy() in Sortable.destroy()

Hi,

I recently faced a problem after I destroyed a Sortable instance and created a new one. Sortable internally uses a DD.Delegate and a DD.Drop instance. The delegate was destroyed properly but not the drop instance. That was leading to an "ghost" shim in the DOM attached with some mouse listeners.

After creating a new Sortable instance, the old shim was still there beside the new one. Dragging one node leads to a call on both shim's event listener and the old one then throws a "TypeError: Cannot read property 'className' of null"

For the fix I made the drop instance a property of sortable and destroyed the drop instance in the destructor of sortable.

Since this is my first yui pull request, pleas comment on this request if i missed something.

Cheers,
Ben