some styling

This commit is contained in:
Robin Appelman 2025-10-06 21:54:21 +02:00
commit 4c4a9119b3
2 changed files with 50 additions and 5 deletions

View file

@ -79,6 +79,7 @@ const addTextElement = () => {
let textCol = document.createElement('td');
textCol.classList.add('text');
textCol.colSpan = 2;
let textInput = document.createElement('input');
textInput.type = "text";
textInput.addEventListener('input', render);
@ -114,11 +115,20 @@ const addImageElement = () => {
imageCol.classList.add('image');
let imageInput = document.createElement('input');
imageInput.type = 'file';
let imageId = `image-input-${id}`;
imageInput.id = imageId;
imageInput.addEventListener('change', loadImage);
let imageLabel = document.createElement('label');
imageLabel.appendChild(document.createTextNode("Browse..."));
imageLabel.setAttribute('for', imageId);
let thumbCol = document.createElement('td');
thumbCol.classList.add('preview');
let imageThumb = document.createElement('img');
imageCol.appendChild(imageLabel);
imageCol.appendChild(imageInput);
imageCol.appendChild(imageThumb);
thumbCol.appendChild(imageThumb);
row.appendChild(imageCol);
row.appendChild(thumbCol);
addElementControls(row);
elementsTableBody.appendChild(row);