Re: [whatwg] HTML5 Drag-and-Drop Specification: dragenter

2010-08-16 Thread David Bruant

Le 17/08/2010 02:04, Jason Gross a écrit :
Is it possible to get more specificity than just the type of the 
object being dragged?  For example, if I have red images and blue 
images, and a red target and a blue target, and I want to be able to 
drop red images only on the red target, and blue images only on the 
blue target, is there a good way to do this, other than globally keep 
track of which thing is being dragged?
I think I give a good example in my e-mail : 
http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2010-August/027948.html 
(do Ctrl+F "(function" to find it).
In this e-mail I talk about drag and drop and the fact that for the use 
case where drag and drop operations occur within the same document, the 
dataTransfer object is pointless in my opinion.


David


Thanks.

-Jason

On Mon, Aug 16, 2010 at 7:57 PM, Daniel Cheng > wrote:


I don't think anything in the spec should prevent that. dragenter
handlers attached to different drop targets can check
event.dataTransfer.types and decide if they want to accept the
drag or not.

That being said, do any operating systems actually support
multiple concurrent drags and drops? WebKit has some built-in
assumptions about there being no more than one drag-and-drop
operation (per page possibly--I can't test, since I don't have
access to a machine with multi-touch capabilities) and I would be
surprised if many other applications didn't have this limitation
as well.

Daniel

On Thu, Aug 12, 2010 at 16:26, Jason Gross
mailto:jasongross9%2bht...@gmail.com>> wrote:

Greetings,
The specification says that the dragenter event is "used to
determine whether or not the drop target is to accept the
drop".  Do functions bound to this event get any information
about the object being dragged?  In particular, is there a
good way to have N drop targets, and have each of them accept
only certain draggables?  If not, it seems to me like a good
feature to have, especially as
multi-touch applications/devices become more prevalent.
Thanks.

Sincerely,
Jason Gross







Re: [whatwg] HTML5 Drag-and-Drop Specification: dragenter

2010-08-16 Thread Daniel Cheng
You can set types of your choice in dragstart, since your drag source should
know which is which. By design, drop targets can't inspect anything but the
types until the object is actually dropped.

Daniel

On Mon, Aug 16, 2010 at 17:04, Jason Gross

> wrote:

> Is it possible to get more specificity than just the type of the object
> being dragged?  For example, if I have red images and blue images, and a red
> target and a blue target, and I want to be able to drop red images only on
> the red target, and blue images only on the blue target, is there a good way
> to do this, other than globally keep track of which thing is being dragged?
> Thanks.
>
> -Jason
>
>
> On Mon, Aug 16, 2010 at 7:57 PM, Daniel Cheng  wrote:
>
>> I don't think anything in the spec should prevent that. dragenter handlers
>> attached to different drop targets can check event.dataTransfer.types and
>> decide if they want to accept the drag or not.
>>
>> That being said, do any operating systems actually support multiple
>> concurrent drags and drops? WebKit has some built-in assumptions about there
>> being no more than one drag-and-drop operation (per page possibly--I can't
>> test, since I don't have access to a machine with multi-touch capabilities)
>> and I would be surprised if many other applications didn't have this
>> limitation as well.
>>
>> Daniel
>>
>> On Thu, Aug 12, 2010 at 16:26, Jason Gross 
>> 
>> > wrote:
>>
>>> Greetings,
>>> The specification says that the dragenter event is "used to determine
>>> whether or not the drop target is to accept the drop".  Do functions bound
>>> to this event get any information about the object being dragged?  In
>>> particular, is there a good way to have N drop targets, and have each of
>>> them accept only certain draggables?  If not, it seems to me like a good
>>> feature to have, especially as multi-touch applications/devices become more
>>> prevalent.
>>> Thanks.
>>>
>>> Sincerely,
>>> Jason Gross
>>>
>>
>>
>


Re: [whatwg] HTML5 Drag-and-Drop Specification: dragenter

2010-08-16 Thread Jason Gross
Is it possible to get more specificity than just the type of the object
being dragged?  For example, if I have red images and blue images, and a red
target and a blue target, and I want to be able to drop red images only on
the red target, and blue images only on the blue target, is there a good way
to do this, other than globally keep track of which thing is being dragged?
Thanks.

-Jason

On Mon, Aug 16, 2010 at 7:57 PM, Daniel Cheng  wrote:

> I don't think anything in the spec should prevent that. dragenter handlers
> attached to different drop targets can check event.dataTransfer.types and
> decide if they want to accept the drag or not.
>
> That being said, do any operating systems actually support multiple
> concurrent drags and drops? WebKit has some built-in assumptions about there
> being no more than one drag-and-drop operation (per page possibly--I can't
> test, since I don't have access to a machine with multi-touch capabilities)
> and I would be surprised if many other applications didn't have this
> limitation as well.
>
> Daniel
>
> On Thu, Aug 12, 2010 at 16:26, Jason Gross 
> 
> > wrote:
>
>> Greetings,
>> The specification says that the dragenter event is "used to determine
>> whether or not the drop target is to accept the drop".  Do functions bound
>> to this event get any information about the object being dragged?  In
>> particular, is there a good way to have N drop targets, and have each of
>> them accept only certain draggables?  If not, it seems to me like a good
>> feature to have, especially as multi-touch applications/devices become more
>> prevalent.
>> Thanks.
>>
>> Sincerely,
>> Jason Gross
>>
>
>


Re: [whatwg] HTML5 Drag-and-Drop Specification: dragenter

2010-08-16 Thread Daniel Cheng
I don't think anything in the spec should prevent that. dragenter handlers
attached to different drop targets can check event.dataTransfer.types and
decide if they want to accept the drag or not.

That being said, do any operating systems actually support multiple
concurrent drags and drops? WebKit has some built-in assumptions about there
being no more than one drag-and-drop operation (per page possibly--I can't
test, since I don't have access to a machine with multi-touch capabilities)
and I would be surprised if many other applications didn't have this
limitation as well.

Daniel

On Thu, Aug 12, 2010 at 16:26, Jason Gross

> wrote:

> Greetings,
> The specification says that the dragenter event is "used to determine
> whether or not the drop target is to accept the drop".  Do functions bound
> to this event get any information about the object being dragged?  In
> particular, is there a good way to have N drop targets, and have each of
> them accept only certain draggables?  If not, it seems to me like a good
> feature to have, especially as multi-touch applications/devices become more
> prevalent.
> Thanks.
>
> Sincerely,
> Jason Gross
>


[whatwg] HTML5 Drag-and-Drop Specification: dragenter

2010-08-12 Thread Jason Gross
Greetings,
The specification says that the dragenter event is "used to determine
whether or not the drop target is to accept the drop".  Do functions bound
to this event get any information about the object being dragged?  In
particular, is there a good way to have N drop targets, and have each of
them accept only certain draggables?  If not, it seems to me like a good
feature to have, especially as multi-touch applications/devices become more
prevalent.
Thanks.

Sincerely,
Jason Gross