small cleanup

This commit is contained in:
Patrick 2026-05-20 13:53:45 +02:00
parent a7f3618cf1
commit 4cb34a8761
1 changed files with 5 additions and 23 deletions

View File

@ -355,7 +355,7 @@ class Editor {
this._editor,
getRelativeClientRect(this._imgElement),
{ width: this._imgElement.naturalWidth, height: this._imgElement.naturalHeight },
4/3);
this.aspectRatio);
document.querySelector("#theatergf-edit-save").style.visibility = "visible";
});
@ -543,28 +543,6 @@ class GalleryItemElement extends HTMLElement {
customElements.define("ttgf-gallery-item", GalleryItemElement)
/*function create_gallery_element(image_src) {
const element = document.createElement("div");
element.classList.add("image-container")
const spinner = document.createElement("span");
spinner.classList.add("spinner", "is-active");
element.appendChild(spinner);
const image_element = new Image();
image_element.addEventListener('load', (_) => {
spinner.classList.remove("is-active")
})
image_element.addEventListener('error', (_) => {
spinner.classList.remove("is-active")
})
image_element.src = image_src
element.appendChild(image_element)
return element;
}*/
function create_gallery_element(id, image_src, selected) {
const e = document.createElement("ttgf-gallery-item");
@ -577,6 +555,8 @@ function create_gallery_element(id, image_src, selected) {
async function load_gallery() {
console.log("loading gallery");
const spinner = document.querySelector('.gallery-container .spinner');
spinner.classList.add("is-active");
@ -602,6 +582,8 @@ async function load_gallery() {
return;
}
gallery.replaceChildren();
json.forEach((v) => {
const item = create_gallery_element(v["ID"], v["thumbnail_src"], v["selected"])
item.addEventListener("click", (e) => {