mirror of
https://github.com/picocss/pico.git
synced 2025-04-25 02:36:15 -04:00
Got the file validation and previewer lines up nicer
This commit is contained in:
parent
7602474cfd
commit
b611b528bc
239 changed files with 5076 additions and 3137 deletions
|
@ -86,15 +86,14 @@ class FileValidator {
|
|||
imagePreview.src = URL.createObjectURL(file);
|
||||
imagePreview.style.maxWidth = "50px";
|
||||
imagePreview.style.maxHeight = "50px";
|
||||
imagePreview.style.marginRight = "10px";
|
||||
imagePreview.onload = () => URL.revokeObjectURL(imagePreview.src); // Release memory
|
||||
listItem.prepend(imagePreview);
|
||||
}
|
||||
|
||||
// Add a remove button
|
||||
const removeButton = document.createElement("button");
|
||||
removeButton.textContent = "🗙";
|
||||
removeButton.className = "outline btn-file-rm";
|
||||
removeButton.textContent = " ";
|
||||
removeButton.className = "btn-file-rm";
|
||||
removeButton.addEventListener("click", () => this.removeFile(file, listItem));
|
||||
|
||||
listItem.append(removeButton);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue