mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
feature(dom) Loader: add xhr.upload progress
This commit is contained in:
parent
e666d69d48
commit
beffc91c28
1 changed files with 10 additions and 0 deletions
|
|
@ -659,6 +659,16 @@ var CloudCmd, Util, DOM, CloudFunc;
|
|||
if (p.responseType)
|
||||
xhr.responseType = p.responseType;
|
||||
|
||||
Events.add('progress', function(event) {
|
||||
var percent = (event.loaded / event.total) * 100,
|
||||
count = Math.round(percent),
|
||||
msg = lType + ' ' + p.url + ': ' + percent + '%';
|
||||
|
||||
if (event.lengthComputable)
|
||||
Util.log(msg);
|
||||
|
||||
}, xhr.upload);
|
||||
|
||||
Events.add('readystatechange', function(pEvent) {
|
||||
if (xhr.readyState === 4 /* Complete */) {
|
||||
var lJqXHR = pEvent.target,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue