瀏覽代碼

pass id

master
Pascal Gloor 5 年之前
父節點
當前提交
56c004c255
共有 1 個檔案被更改,包括 15 行新增9 行删除
  1. 15
    9
      www/js/autodoc.js

+ 15
- 9
www/js/autodoc.js 查看文件

@@ -220,15 +220,14 @@ function upload_handler() {
else {
var reader = new FileReader();
file['progress'] = 1;
$(reader).on({
loadstart: upload_read_event,
load: upload_read_event,
loadend: upload_read_event,
progress: upload_read_event,
error: upload_read_event,
abort: upload_read_event
});

$(reader).on('load', id, upload_read_event);
$(reader).on('loadstart', id, upload_read_event);
$(reader).on('loadend', id, upload_read_event);
$(reader).on('progress', id, upload_read_event);
$(reader).on('error', id, upload_read_event);
$(reader).on('abort', id, upload_read_event);

reader.readAsArrayBuffer(file.obj);
}
}
@@ -241,6 +240,13 @@ function upload_handler() {
}

function upload_read_event(e) {
if ( e.type == 'progress' ) {
var progress = Math.floor(e.originalEvent.loaded / e.originalEvent.total * 50);
if ( percent < 1 ) { percent = 1; }
if ( percent >= 100 ) { perc}
}

}
console.log(e);
}


Loading…
取消
儲存