[whatwg] Proposal for public data in drag events
Bronislav Klučka
Bronislav.Klucka at bauglir.com
Thu Aug 30 11:33:04 PDT 2012
On 30.8.2012 19:27, Ian Hickson wrote:
> On Thu, 21 Jun 2012, Trevor Burnham wrote:
>
>> Therefore, I'd like to propose the addition of a "publicData" object on
>> all drag events. It would have the same interface and behavior as the
>> dataTransfer object, with the sole exception that it would be read-only
>> in all events where dataTransfer is protected. That is, publicData would
>> be read/write in dragStart, and read-only in all other drag-and-drop
>> events.
> That's an interesting idea. I suppose we could expose it using a custom
> type in cross-app OS dnd situations, too.
>
> Could you elaborate on your use case? Are there cross-window use cases for
> this? (For in-window cases, you could instead just use a global.)
>
Very interesting idea...
Using globals is a way, bud a just a way, definitely not a good idea in
general... (using globals in general, putting some information about
gragged object into DataTransfer, some into some global variable)...
That's bad even for one window app.
If you want example of cross window, I can give you one, I was working
on administration, where certain information were presented using the
same DOM constructions but they can be inserted/placed in different
views so I've created the application as a set of iframes. But while
using D&D I've run into similar problem (I had a treeview of categories
and certain data from another iframe can be copied/moved to certain
nodes, not every data to every node), I had to solve it by putting data
information in drag data item type... Being able to access some complex
data in e.g. dragover event would be peachy
Brona
More information about the whatwg
mailing list