Browse Source

Pull request #1418: 保证文件返回的顺序

Merge in VISUAL/fineui from ~GUY/fineui:master to master

* commit '6c52318f29d0f3ce2c77f30ed29eb3dea721db1c':
  保证文件返回的顺序
es6
guy 4 years ago
parent
commit
8d767d2034
  1. 10
      src/base/single/input/file.js

10
src/base/single/input/file.js

@ -103,6 +103,7 @@
// FireFox 3+, Safari 4 beta (Chrome 2 beta file is buggy and will not work)
if (xhr.upload || xhr.sendAsBinary) {
sendFile = function (handler, maxSize, width, height) {
var current = handler.current;
if (-1 < maxSize && maxSize < handler.file.fileSize) {
if (isFunction(handler.onerror)) {
handler.onerror();
@ -190,7 +191,7 @@
if (handler.file.type.indexOf("image") != -1) {
attachO.attach_type = "image";
}
handler.attach_array.push(attachO);
handler.attach_array[current] = attachO;
} else {
upload["onerror"]({});
}
@ -211,7 +212,7 @@
handler.attach_array[0] = attachO;
// handler.attach_array.push(attachO);
} else {
handler.attach_array.push(attachO);
handler.attach_array[current] = attachO;
}
break;
}
@ -238,6 +239,7 @@
// Internet Explorer, Opera, others
else {
sendFile = function (handler, maxSize, width, height) {
var current = handler.current;
var url = handler.url.concat(-1 === handler.url.indexOf("?") ? "?" : "&", "AjaxUploadFrame=true"),
rpe = {
loaded: 1, total: 100, simulation: true, interval: setInterval(function () {
@ -272,7 +274,7 @@
if (handler.maxlength == 1) {
handler.attach_array[0] = attachO;
} else {
handler.attach_array.push(attachO);
handler.attach_array[current] = attachO;
}
} catch (e) {
if (isFunction(handler.onerror)) {
@ -645,4 +647,4 @@
BI.File.EVENT_PROGRESS = "EVENT_PROGRESS";
BI.File.EVENT_UPLOADED = "EVENT_UPLOADED";
BI.shortcut("bi.file", BI.File);
})(_global.document || {});
})(_global.document || {});

Loading…
Cancel
Save