Skip to content

Commit 24b15c5

Browse files
authoredSep 23, 2020
doc: Improve progressEvent documentation (#280)
1 parent 4a1e766 commit 24b15c5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed
 

‎README.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,17 @@ var headers={'headerParam':'headerValue', 'headerParam2':'headerValue2'};
164164
options.headers = headers;
165165

166166
var ft = new FileTransfer();
167+
var progressValue = 0;
167168
ft.onprogress = function(progressEvent) {
168169
if (progressEvent.lengthComputable) {
169-
loadingStatus.setPercentage(progressEvent.loaded / progressEvent.total);
170+
// Calculate the percentage
171+
progressValue = progressEvent.loaded / progressEvent.total;
170172
} else {
171-
loadingStatus.increment();
173+
progressValue++;
172174
}
175+
176+
// Display percentage in the UI
177+
document.getElementByID('progress-value').innerHTML = progressValue;
173178
};
174179
ft.upload(fileURL, uri, win, fail, options);
175180
```

0 commit comments

Comments
 (0)
Failed to load comments.