[whatwg] Drag and drop in HTML5

On 5 May 2005 at 21:12, Ian Hickson wrote:

> > Perhaps a way to specify a "drag-group" to say that certain elements 
> > considered draggable should be dragged together.

> Do you mean that instead of labelling each draggable element as draggable, 
> you would instead add each draggable element to a list?

I suppose the most powerful API might have both a "draggable" and a 
"dragGroup" property on nodes, but this may of course be too complex.

*  The "baseline" option is to support draggable=true or some 
equivalent and let user drag and drop one such item at a time. 
* One alternative is to say that all items with draggable=true always 
are dragged - it requires a bit more caution by the JS author and the 
user - 
* The third way would be a draggable node list *and* a draggable 
property. (Only a list is functionally same as the option above)


This is the way I thought it might work:

When a drag action starts on an element that has draggable set to 
true, the UA checks if the dragGroup property of the element is set. 
If it is set, it performs a "drag" action on all the elements that 
refer to the same drag group and have their draggable property set to 
true.

A use case might be a complex web mail interface where you can drag 
both contacts and E-mails, and drag only those you select by 
checkboxes or by clicking on them. Such an interface requires that 
you can drag multiple items, and distinguish different groups of 
multiple items.

It would be really neat to have a CSS-like inheritance for the 
dragGroup so that you could specify it once - say 

<div draggroup="mail">
[list of E-mails, for example using UL, LI and A markup]
</div>

and all child nodes would drag together if selected. :-)
-- 
Hallvord Reiar Michaelsen Steen
http://www.hallvord.com/

Received on Thursday, 5 May 2005 14:40:35 UTC