j-DropFiles
- singleton
- captures all dropped files into the
window - must be located under
<body>element due to positioning
Configuration:
exec {String}a link to thefunction(files, e)- NEW:
check {String}optional, a link to thefunction(e)that must returntrue(allows drag&drop) orfalse(disallow)
Use it with <ui-component name="dropfiles">. When the component is not loaded yet, jComponent downloads it on first use from the address in DEF.fallback (the Componentator CDN by default). Author: Peter Širka. Source: the Componentator components repository, MIT license.
<ui-component name="dropfiles" config="exec:dropfiles" class="hidden">
Drag & Drop files here
</ui-component>
<script>
function dropfiles(files, evt) {
console.log(files, evt);
/*
var data = new FormData();
for (var i = 0, length = files.length; i < length; i++)
data.append('file' + i, files[i]);
UPLOAD('/api/upload/', data, function(response) {
console.log(response);
});
*/
}
</script>