forked from MarseyWorld/MarseyWorld
fix first image not uploading
parent
da0cb474bd
commit
ed8713e34e
|
@ -487,17 +487,16 @@ function handle_files(input, newfiles) {
|
||||||
|
|
||||||
const ta = input.parentElement.parentElement.parentElement.parentElement.querySelector('textarea.file-ta');
|
const ta = input.parentElement.parentElement.parentElement.parentElement.querySelector('textarea.file-ta');
|
||||||
|
|
||||||
if (oldfiles[ta.id]) {
|
if (!oldfiles[ta.id]) {
|
||||||
for (const file of newfiles) {
|
|
||||||
oldfiles[ta.id].items.add(file);
|
|
||||||
}
|
|
||||||
input.files = oldfiles[ta.id].files;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
input.files = newfiles;
|
|
||||||
oldfiles[ta.id] = new DataTransfer();
|
oldfiles[ta.id] = new DataTransfer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (const file of newfiles) {
|
||||||
|
oldfiles[ta.id].items.add(file);
|
||||||
|
}
|
||||||
|
input.files = oldfiles[ta.id].files;
|
||||||
|
|
||||||
|
|
||||||
if (input.files.length > 20)
|
if (input.files.length > 20)
|
||||||
{
|
{
|
||||||
window.alert("You can't upload more than 20 files at one time!")
|
window.alert("You can't upload more than 20 files at one time!")
|
||||||
|
|
Loading…
Reference in New Issue