sproutcore/sproutcore — pull request #1146 by dcporter (2013-12-12 05:17:18+00:00)
Title: Data Drag Events

See previous monologue in #1139.

Browsers deal differently with data drag events (e.g. when the user drags text, an image, a URL or a file into the browser), so they need to be set up and handled differently in SproutCore. Previously there was no support at all for them, so drag/drop views had to attach their own DOM event handlers (a sure sign that something was missing).

I've implemented a set of dataDrag events, parallel to the normal mouse events. I've included some global defaultResponder copies as well, for your statecharting pleasure. As a pleasant side effect, I've also by default prevented the default behavior on URL and file drags, which is to leave the application and open the dropped item.

I've included documentation and unit tests, as well as documentation and unit tests for the rest of RootResponder's events, which is sorely lacking.

This code is in use in one project and behaving well in another application that doesn't use it. As soon as I get up to speed on the showcase, I'll add a demo app there.