Package Exports
- drag-and-drop-files
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (drag-and-drop-files) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
drag-and-drop-files
Handle file drag and drop events in an HTML5 capable browser with less Yak shaving.
Example
var dropTarget = document.querySelector("#dropTarget")
require("drag-and-drop-files")(dropTarget, function(files) {
console.log("Got some files:", files)
})Install
npm install drag-and-drop-filesrequire("drag-and-drop-files")(element, callback(files) )
Hooks a listener for a file data transfer event.
elementis the DOM element to listen for file events oncallback(files)is a callback that gets fired when the files are dropped on to it. The argumentfilesis an array of all the file objects that were dragged onto the element.
Credits
(c) 2013 Mikola Lysenko. MIT License