refactor(dom) Loader: mv percent, count, msg to if

This commit is contained in:
coderaiser 2013-09-13 09:17:07 +00:00
parent 5a52847ef8
commit c0b6c47939

View file

@ -660,12 +660,14 @@ var CloudCmd, Util, DOM, CloudFunc;
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 + '%';
var percent, count, msg;
if (event.lengthComputable)
if (event.lengthComputable) {
percent = (event.loaded / event.total) * 100,
count = Math.round(percent),
msg = lType + ' ' + p.url + ': ' + count + '%';
Util.log(msg);
}
}, xhr.upload);