Multiple_file_drag_and_drop_upload icon indicating copy to clipboard operation
Multiple_file_drag_and_drop_upload copied to clipboard

Clear file list button addition

Open LuukBarten opened this issue 12 years ago • 0 comments

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>

LuukBarten avatar Feb 13 '13 16:02 LuukBarten