This commit is contained in:
2026-02-06 12:19:15 +01:00
committed by Florian Greistorfer
parent d88351d0ab
commit 6f7a3fe180

View File

@@ -52,6 +52,7 @@ class PhotoGallery {
const img = document.createElement("img"); const img = document.createElement("img");
img.src = this.shown[imgIndex]?.src || ""; img.src = this.shown[imgIndex]?.src || "";
console.log("Prefetching image:", img);
prefetchDiv.appendChild(img); prefetchDiv.appendChild(img);
} }
@@ -62,6 +63,7 @@ class PhotoGallery {
const img = prefetchDiv.querySelector(`img[src="${this.shown[imgIndex]?.src || ""}"]`); const img = prefetchDiv.querySelector(`img[src="${this.shown[imgIndex]?.src || ""}"]`);
if (img) { if (img) {
prefetchDiv.removeChild(img); prefetchDiv.removeChild(img);
console.log("Cancelled prefetch for image:", img);
} }
} }