mirror of https://gitee.com/karson/fastadmin.git
优化分片上传
parent
8130a49fab
commit
bba702bd18
|
|
@ -252,11 +252,7 @@ define(['jquery', 'bootstrap', 'dropzone', 'template'], function ($, undefined,
|
||||||
},
|
},
|
||||||
uploadprogress: function (file, progress, bytesSent) {
|
uploadprogress: function (file, progress, bytesSent) {
|
||||||
if (file.upload.chunked) {
|
if (file.upload.chunked) {
|
||||||
var totalBytesSent = 0;
|
$(this.element).prop("disabled", true).html("<i class='fa fa-upload'></i> " + __('Upload') + Math.floor((file.upload.bytesSent / file.size) * 100) + "%");
|
||||||
file.upload.chunks.forEach(function (item) {
|
|
||||||
totalBytesSent += item.bytesSent;
|
|
||||||
});
|
|
||||||
$(this.element).prop("disabled", true).html("<i class='fa fa-upload'></i> " + __('Upload') + Math.floor((totalBytesSent / file.size) * 100) + "%");
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
totaluploadprogress: function (progress, bytesSent) {
|
totaluploadprogress: function (progress, bytesSent) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue