Skip to content

fix bug when process-bar show 100% but file not uploaded #10

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

Merged
merged 1 commit into from
Apr 23, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions demo/js/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,11 @@ FileProgress.prototype.setProgress = function(percentage, speed, chunk_size) {
var formatSpeed = plupload.formatSize(speed).toUpperCase();
var progressbar = this.fileProgressWrapper.find('td .progress').find('.progress-bar-info');
this.fileProgressWrapper.find('.status').text("已上传: " + size + " 上传速度: " + formatSpeed + "/s");

progressbar.attr('aria-valuenow', parseInt(percentage, 10)).css('width', percentage);

percentage = parseInt(percentage, 10);
if (file.status !== plupload.DONE && percentage === 100) {
percentage = 99;
}
progressbar.attr('aria-valuenow', percentage).css('width', percentage + '%');

if (chunk_size) {
var chunk_amount = Math.ceil(file.size / chunk_size);
Expand Down