Skip to content

Commit 49ebd2e

Browse files
committed
Merge pull request #10 from qiniupd/fix_ui_bug
fix bug when process-bar show 100% but file not uploaded
2 parents ab1863e + 36af889 commit 49ebd2e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

demo/js/ui.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,11 @@ FileProgress.prototype.setProgress = function(percentage, speed, chunk_size) {
137137
var formatSpeed = plupload.formatSize(speed).toUpperCase();
138138
var progressbar = this.fileProgressWrapper.find('td .progress').find('.progress-bar-info');
139139
this.fileProgressWrapper.find('.status').text("已上传: " + size + " 上传速度: " + formatSpeed + "/s");
140-
141-
progressbar.attr('aria-valuenow', parseInt(percentage, 10)).css('width', percentage);
142-
140+
percentage = parseInt(percentage, 10);
141+
if (file.status !== plupload.DONE && percentage === 100) {
142+
percentage = 99;
143+
}
144+
progressbar.attr('aria-valuenow', percentage).css('width', percentage + '%');
143145

144146
if (chunk_size) {
145147
var chunk_amount = Math.ceil(file.size / chunk_size);

0 commit comments

Comments
 (0)