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

Progressbar is not show when "autoUpload" options is set #8

Open
Darksoulsong opened this issue Feb 7, 2014 · 1 comment
Open

Progressbar is not show when "autoUpload" options is set #8

Darksoulsong opened this issue Feb 7, 2014 · 1 comment

Comments

@Darksoulsong
Copy link

I'm having this issue and I've tried to change things on my own, but with little success.

I figured out that the "updateProgress" method is not called properly to update the upload status (even for big files). But this happens only if the autoUpload option is set to true, as aforementioned.

Edit

The updateProgress is called allright, the "hidden" class is removed but the progress bar does't shows up.

Edit 2

A workaround:

  • Remove the "hidden" class from the progress element on the template file

  • Comment the line (or around) 433, where the "hidden" class is added, like so:

           if (this.model.isPending()) {
                // when_running.add(when_done).addClass('hidden');
                when_pending.removeClass('hidden');
            } else if (this.model.isRunning()) {
                when_pending.add(when_done).addClass('hidden');
                when_running.removeClass('hidden');
            } else if (this.model.isDone() || this.model.isError()) {
                when_pending.add(when_running).addClass('hidden');
                when_done.removeClass('hidden');
            }
    
@stolendog
Copy link

It will not work, because file model state will be still "pending". If I am using autoUpload option, I add file.start() on "fileadd" event:

bindLocal: function ()
        {
            var self = this;
            this.on('fileadd', function (file) {
                // Add it to current list
                self.files.add(file);

                // Create the view
                self.renderFile(file);
                file.start(); 
            }).on('fileprogress', function (file, progress) {
                // console.log("file progressss");
                file.progress(progress);
            }).on('filefail', function (file, error) {
                file.fail(error);
            }).on('filedone', function (file, data) {
                file.done(data.result);
            });

            // When collection changes
            this.files.on('all', this.update, this);
        }

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

2 participants