mirror of
https://github.com/lxsang/antos-frontend.git
synced 2024-12-26 01:18:21 +01:00
create a new input file for each upload
This commit is contained in:
parent
25f95360d6
commit
b69103107c
Binary file not shown.
@ -1208,7 +1208,10 @@ namespace OS {
|
||||
return new Promise(function (resolve, reject) {
|
||||
const q = announcer.getMID();
|
||||
//insert a temporal file selector
|
||||
const o = $("#antos_upload_files");
|
||||
const o =
|
||||
$("<input>")
|
||||
.attr("type","file")
|
||||
.attr("multiple","true");
|
||||
o.on("change", function () {
|
||||
const files = (o[0] as HTMLInputElement).files;
|
||||
const n_files = files.length;
|
||||
@ -1232,18 +1235,20 @@ namespace OS {
|
||||
{
|
||||
API.loaded(q, p, "OK");
|
||||
resolve(data);
|
||||
o.remove();
|
||||
}
|
||||
})
|
||||
.fail(function (j, s, e) {
|
||||
tasks.push("FAIL");
|
||||
if (tasks.length == n_files)
|
||||
{
|
||||
API.loaded(q, p, "FAIL");
|
||||
o.remove();
|
||||
}
|
||||
reject(API.throwe(s));
|
||||
});
|
||||
});
|
||||
});
|
||||
($("#antos_upload_form")[0] as HTMLFormElement).reset();
|
||||
(o[0] as HTMLInputElement).value = "";
|
||||
return o.trigger("click");
|
||||
});
|
||||
}
|
||||
|
@ -1222,9 +1222,6 @@ namespace OS {
|
||||
<afx-menu id="contextmenu" data-id="contextmenu" context="true" style="display:none;"></afx-menu>
|
||||
<afx-label id="systooltip" data-id="systooltip" style="display:none;position:absolute;"></afx-label>
|
||||
<textarea id="clipboard"></textarea>\
|
||||
<form id="antos_upload_form" style="display: none;">\
|
||||
<input type="file" id="antos_upload_files" name="files" multiple>\
|
||||
</form>\
|
||||
`;
|
||||
|
||||
schemes.login = `\
|
||||
|
Loading…
Reference in New Issue
Block a user