mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
chore(load) es2015-ify
This commit is contained in:
parent
b972b5eff3
commit
e547187490
1 changed files with 6 additions and 8 deletions
|
|
@ -218,15 +218,13 @@ module.exports.put = (url, body) => {
|
|||
xhr.open('put', url, true);
|
||||
|
||||
xhr.upload.onprogress = (event) => {
|
||||
var percent, count;
|
||||
if (!event.lengthComputable)
|
||||
return;
|
||||
|
||||
if (event.lengthComputable) {
|
||||
percent = (event.loaded / event.total) * 100;
|
||||
count = Math.round(percent);
|
||||
|
||||
emitter.emit('progress', count);
|
||||
}
|
||||
|
||||
const percent = (event.loaded / event.total) * 100;
|
||||
const count = Math.round(percent);
|
||||
|
||||
emitter.emit('progress', count);
|
||||
};
|
||||
|
||||
xhr.onreadystatechange = () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue