MCPcopy
hub / github.com/nervgh/angular-file-upload / _getTotalProgress

Method _getTotalProgress

src/services/FileUploader.js:339–348  ·  view source on GitHub ↗

* Returns the total progress * @param {Number} [value] * @returns {Number} * @private

(value)

Source from the content-addressed store, hash-verified

337 * @private
338 */
339 _getTotalProgress(value) {
340 if(this.removeAfterUpload) return value || 0;
341
342 var notUploaded = this.getNotUploadedItems().length;
343 var uploaded = notUploaded ? this.queue.length - notUploaded : this.queue.length;
344 var ratio = 100 / this.queue.length;
345 var current = (value || 0) * ratio / 100;
346
347 return Math.round(uploaded * ratio + current);
348 }
349 /**
350 * Returns array of filters
351 * @param {Array<Function>|String} filters

Callers 4

doneMethod · 0.95
removeFromQueueMethod · 0.95
_onProgressItemMethod · 0.95
_onCompleteItemMethod · 0.95

Calls 1

getNotUploadedItemsMethod · 0.95

Tested by

no test coverage detected