Skip to content

Commit

Permalink
Merge pull request qiniu#10 from qiniupd/fix_ui_bug
Browse files Browse the repository at this point in the history
fix bug when process-bar show 100% but file not uploaded
  • Loading branch information
SunLn committed Apr 23, 2014
2 parents ab1863e + 36af889 commit 49ebd2e
Showing 1 changed file with 5 additions and 3 deletions.
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

0 comments on commit 49ebd2e

Please sign in to comment.