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

reset() doesn't remove all upload files #11

Open
rustyx opened this issue May 30, 2015 · 1 comment
Open

reset() doesn't remove all upload files #11

rustyx opened this issue May 30, 2015 · 1 comment

Comments

@rustyx
Copy link

rustyx commented May 30, 2015

When there is more than 1 file to upload, calling upload.reset() does not clear the upload list fully.

@rustyx
Copy link
Author

rustyx commented May 30, 2015

This seems to be due to a bug in this code:

        self.reset = function() {
            var files = inputFiles.getFiles();
            for (var i = 0; i < files.length; i++){
                inputFiles.remove(files[i]);
            }
        };

This essentially deletes only half of the entries.

To fix it, replace with:

        self.reset = function() {
            var files = inputFiles.getFiles();
            for (var i = files.length - 1; i >= 0; i--){
                inputFiles.remove(files[i]);
            }
        };

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