MochiKit Tip: Un-register (delete) a draggable

Alright, a quick tip for those of you who don’t know – here’s how you can unregister (delete) a draggable in MochiKit:
dragHandle = new Draggable( [...] );    // Registers the drag handle
dragHandle.destroy();                   // Destroying the drag handle
You can then check by looking in:
window.MochiKit.DragAndDrop.Draggables.drags
and
window.MochiKit.Signal._observers
The draggable and the signal "observer" should be gone.
 
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: