mirror of
https://github.com/acanas/swad-core.git
synced 2024-09-24 00:01:03 +02:00
36 lines
853 B
JavaScript
36 lines
853 B
JavaScript
|
// "myAwesomeDropzone" is the camelized version of the HTML element's ID
|
||
|
Dropzone.options.myAwesomeDropzone =
|
||
|
{
|
||
|
maxFiles: 10,
|
||
|
parallelUploads: 10,
|
||
|
//forceFallback: true,
|
||
|
init: function()
|
||
|
{
|
||
|
var filesAdded = 0;
|
||
|
|
||
|
this.on("addedfile", function(file)
|
||
|
{
|
||
|
filesAdded++;
|
||
|
//alert("Added file.");
|
||
|
});
|
||
|
|
||
|
// If you don't want to automatically close if there was an error, you can handle
|
||
|
// the success and error events separately
|
||
|
this.on("complete", function(file)
|
||
|
{
|
||
|
filesAdded--;
|
||
|
if (filesAdded == 0)
|
||
|
{
|
||
|
// Do what you have to do.
|
||
|
//alert ("Hecho");
|
||
|
//setTimeout(function(){document.getElementById("form_upload_done").submit();}, 2000);
|
||
|
}
|
||
|
});
|
||
|
},
|
||
|
fallback: function()
|
||
|
{
|
||
|
document.getElementById('dropzone-upload').style.display='none';
|
||
|
document.getElementById('classic-upload').style.display='block';
|
||
|
}
|
||
|
};
|