Handle file drag and drop events without all the Yak shaving
Handle file drag and drop events in an HTML5 capable browser with less Yak shaving.
var dropTarget = documentquerySelector"#dropTarget"require"drag-and-drop-files"dropTargetconsole.log"Got some files:" files
npm install drag-and-drop-files
Hooks a listener for a file data transfer event.
elementis the DOM element to listen for file events on
callback(files)is a callback that gets fired when the files are dropped on to it. The argument
filesis an array of all the file objects that were dragged onto the element.
(c) 2013 Mikola Lysenko. MIT License