Fix reload page before all file uploaded bug (#3534)
This commit is contained in:
@@ -288,12 +288,12 @@
|
|||||||
function uploadFile(file, i) {
|
function uploadFile(file, i) {
|
||||||
var url = window.location.href;
|
var url = window.location.href;
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
|
var fileName = file.name;
|
||||||
xhr.onreadystatechange = function() {
|
xhr.onreadystatechange = function() {
|
||||||
if (xhr.readyState == XMLHttpRequest.DONE) {
|
if (xhr.readyState == XMLHttpRequest.DONE) {
|
||||||
location.reload();
|
finishUpload(fileName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var fileName = file.name;
|
|
||||||
xhr.upload.addEventListener('progress', function(e) {
|
xhr.upload.addEventListener('progress', function(e) {
|
||||||
if (e.lengthComputable) {
|
if (e.lengthComputable) {
|
||||||
var percent = Math.ceil((e.loaded / e.total) * 100);
|
var percent = Math.ceil((e.loaded / e.total) * 100);
|
||||||
|
|||||||
Reference in New Issue
Block a user