Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear file list button addition #2

Open
LuukBarten opened this issue Feb 13, 2013 · 0 comments
Open

Clear file list button addition #2

LuukBarten opened this issue Feb 13, 2013 · 0 comments

Comments

@LuukBarten
Copy link

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant