mirror of
https://github.com/lxsang/antos-frontend.git
synced 2025-04-28 17:46:44 +02: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) {
|
return new Promise(function (resolve, reject) {
|
||||||
const q = announcer.getMID();
|
const q = announcer.getMID();
|
||||||
//insert a temporal file selector
|
//insert a temporal file selector
|
||||||
const o = $("#antos_upload_files");
|
const o =
|
||||||
|
$("<input>")
|
||||||
|
.attr("type","file")
|
||||||
|
.attr("multiple","true");
|
||||||
o.on("change", function () {
|
o.on("change", function () {
|
||||||
const files = (o[0] as HTMLInputElement).files;
|
const files = (o[0] as HTMLInputElement).files;
|
||||||
const n_files = files.length;
|
const n_files = files.length;
|
||||||
@ -1232,18 +1235,20 @@ namespace OS {
|
|||||||
{
|
{
|
||||||
API.loaded(q, p, "OK");
|
API.loaded(q, p, "OK");
|
||||||
resolve(data);
|
resolve(data);
|
||||||
|
o.remove();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.fail(function (j, s, e) {
|
.fail(function (j, s, e) {
|
||||||
tasks.push("FAIL");
|
tasks.push("FAIL");
|
||||||
if (tasks.length == n_files)
|
if (tasks.length == n_files)
|
||||||
|
{
|
||||||
API.loaded(q, p, "FAIL");
|
API.loaded(q, p, "FAIL");
|
||||||
|
o.remove();
|
||||||
|
}
|
||||||
reject(API.throwe(s));
|
reject(API.throwe(s));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
($("#antos_upload_form")[0] as HTMLFormElement).reset();
|
|
||||||
(o[0] as HTMLInputElement).value = "";
|
|
||||||
return o.trigger("click");
|
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-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>
|
<afx-label id="systooltip" data-id="systooltip" style="display:none;position:absolute;"></afx-label>
|
||||||
<textarea id="clipboard"></textarea>\
|
<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 = `\
|
schemes.login = `\
|
||||||
|
Loading…
x
Reference in New Issue
Block a user