Donut DragDrop 0.1 review

Download
by rbytes.net on

Donut DragDrop is a fast, lightweight JavaScript dragdrop library for JavaScript programmers

License: MIT/X Consortium License
File size: 0K
Developer: Peter Michaux
0 stars award from rbytes.net

Donut DragDrop is a fast, lightweight JavaScript dragdrop library for JavaScript programmers. It is not completely plug and play but almost.

Donut DragDrop doesn’t try to be everything to anyone with fancy things like constrained motion as part of the base implemenation. You can add layers on top to add more functionality.

Genesis

First, I had the Donut DragDrop idea. This allows for native browser events to detect the interaction between one or more dragged items and a drop target. I tried implementing it and it worked quite well. My JavaScript for the dragdrop manager was nice and object-oriented but bulky and each draggable and target had an associated JavaScript object.

During a long discussion on the Yahoo! JavaScript discussion group , Tim Hosking suggested ideas for a very lightweight dragdrop manager that might work well for many dragdrop implementations. Instead of a JavaScript object for each draggable and target, Tim suggested using CSS class names “draggable” and “target” to identify these. In this implementation I have used Tim’s ideas and blended them with my donut proxy idea.

On comp.lang.javascript in another long discussion Richard Cornford outlined a way of building layered JavaScript libraries to facilitate small downloads with only the necessary JavaScript for the given implementation but still allowing flexibility and extensibility in the library. I have used my interpretation of Richard’s ideas in this dragdrop implementation.

I have used the Yahoo! UI yahoo.js, dom.js and event.js files. I have taken a few ideas from the Yahoo! UI dragdrop.js file but not the general attitude of that or other dragdrop libraries. All the dragdrop libraries I’ve tried attempt to be everything to everyone and grow larger and less flexible. For example, the minified Yahoo! dragdrop.js is 24 kB but my DragManager.js file minified is only 4kB. The Yahoo! library doesn’t allow for easy trimming of the code to only that which is needed. Also the Yahoo! library is less flexible and more difficult to extend than my Donut library.

Donut DragDrop 0.1 search tags