Multiple_file_drag_and_drop_upload
Multiple_file_drag_and_drop_upload copied to clipboard
Clear file list button addition
When files are not compatible there is no way of clearing the list. Adding the following lines I've solved this.
multiupload.js
After the other add EventListeners:
document.getElementById(this.config.clearbutton).addEventListener("click", this._clearFiles, false);
After the "multiUploader.prototype._dropFiles" function
multiUploader.prototype._clearFiles = function(e){
$("#dragAndDropFiles div").each(
function(){
$(this).empty();
$(this).after($(this).html()).remove();
});
self.all = [];
}
your_script_loader_file.js
During the creation of the config add the id of the clickable element u want to use.
var config = {
clearbutton: "clearbutton",
... // other options
}
HTML
Make sure your HTML element has the same id you set with the config
<a id="clearbutton" href="javascript: void(0);">Clear filelist</a>