[dojo-contributors] DnD constarined move: testers wanted!

Patrick Corcoran dojo-contributors at idlabs.org
Thu Jun 7 11:05:06 EDT 2007

Eugene Lazutkin wrote:
> Hash: SHA1
>> 3) dojo.dnd.constrainedMover
>> It takes a function, which returns a constraint box, and a boolean,
>> which indicates, if we want to constrained the whole object to the box
>> (when it is true), or just the top-left corner (when it is false). By
>> default the second parameter is false. The function is called every time
>> before initializing the corresponding dojo.dnd.Mover.
> ... and returns a constraint box, so every time you starts the move,
> your object can be constrained to different boxes.
>> dojo.dnd.constrainedMover returns a function, which is used to create a
>> mover.
This sounds elegant.

One suggestion/question?  What if you changed the semantics of the 
second argument?  Instead of moving based upon the top-left corner, you 
move based upon the center of the object?  Then you could dispense with 
the second argument altogether, because people could just use 
margin/border/padding settings to keep the movable within the container?

Just a quick thought, I might not have even thought out all the 
ramifications lost in pruning the second argument.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.dojotoolkit.org/pipermail/dojo-contributors/attachments/20070607/f378b78a/attachment.htm 

More information about the dojo-contributors mailing list