()
| 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. |
no test coverage detected