Merge branch 'main' of http://211.119.124.110:3000/xit-app/adds-fo.git into main
commit
4d81700ad1
@ -1,23 +0,0 @@
|
|||||||
function uploadSupport(selector) {
|
|
||||||
let input = $(selector);
|
|
||||||
if (!input)
|
|
||||||
throw "Element not found: " + selector;
|
|
||||||
|
|
||||||
let fileset = new Dataset({
|
|
||||||
keymapper: info => info.id
|
|
||||||
});
|
|
||||||
|
|
||||||
input.change(function() {
|
|
||||||
var files = $(this).get(0).files,
|
|
||||||
length = files.length,
|
|
||||||
array = []
|
|
||||||
for (var i = 0; i < length; ++i) {
|
|
||||||
var file = files[i];
|
|
||||||
file.id = "file-" + new Date().getTime() + "-" + i;
|
|
||||||
file.url = (window.URL || window.webkitURL).createObjectURL(file);
|
|
||||||
array.push(file);
|
|
||||||
}
|
|
||||||
fileset.setData(array);
|
|
||||||
});
|
|
||||||
return fileset;
|
|
||||||
}
|
|
Loading…
Reference in New Issue