MCPcopy
hub / github.com/dropzone/dropzone / updateTotalUploadProgress

Method updateTotalUploadProgress

src/dropzone.js:427–450  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

425 }
426
427 updateTotalUploadProgress() {
428 let totalUploadProgress;
429 let totalBytesSent = 0;
430 let totalBytes = 0;
431
432 let activeFiles = this.getActiveFiles();
433
434 if (activeFiles.length) {
435 for (let file of this.getActiveFiles()) {
436 totalBytesSent += file.upload.bytesSent;
437 totalBytes += file.upload.total;
438 }
439 totalUploadProgress = (100 * totalBytesSent) / totalBytes;
440 } else {
441 totalUploadProgress = 100;
442 }
443
444 return this.emit(
445 "totaluploadprogress",
446 totalUploadProgress,
447 totalBytes,
448 totalBytesSent
449 );
450 }
451
452 // @options.paramName can be a function taking one parameter rather than a string.
453 // A parameter name for a file is obtained simply by calling this with an index number.

Callers 1

initMethod · 0.95

Calls 2

getActiveFilesMethod · 0.95
emitMethod · 0.80

Tested by

no test coverage detected