Skip to content

Commit 8b00fb4

Browse files
committed
#116: upload data order
1 parent 8cf861e commit 8b00fb4

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

FileAPI.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/FileAPI.core.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,6 +1000,19 @@
10001000
, queue = api.queue(function (){ fn(Form); })
10011001
, isOrignTrans = trans && (parseInt(trans.maxWidth || trans.minWidth || trans.width, 10) > 0 || trans.rotate)
10021002
;
1003+
1004+
1005+
// Append data
1006+
_each(options.data, function add(val, name){
1007+
if( typeof val == 'object' ){
1008+
_each(val, function (v, i){
1009+
add(v, name+'['+i+']');
1010+
});
1011+
}
1012+
else {
1013+
Form.append(name, val);
1014+
}
1015+
});
10031016

10041017

10051018
if( api.Image && trans && (/image/.test(file.type) || _rimgcanvas.test(file.nodeType)) ){
@@ -1045,18 +1058,6 @@
10451058
Form.append(name, file, filename);
10461059
}
10471060

1048-
// Append data
1049-
_each(options.data, function add(val, name){
1050-
if( typeof val == 'object' ){
1051-
_each(val, function (v, i){
1052-
add(v, name+'['+i+']');
1053-
});
1054-
}
1055-
else {
1056-
Form.append(name, val);
1057-
}
1058-
});
1059-
10601061
queue.check();
10611062
},
10621063

0 commit comments

Comments
 (0)