apply id from jl-img to inner image element

This commit is contained in:
Jonas Leder 2022-05-01 13:01:34 +02:00
parent f0e92fe024
commit 50689d2b83
No known key found for this signature in database
GPG key ID: CC3C488E27DFF5CA

View file

@ -27,11 +27,13 @@ class CustomImage extends HTMLElement {
image.setAttribute("style", this.getAttribute("style"));
image.setAttribute("width", this.getAttribute("width"));
image.setAttribute("height", this.getAttribute("height"));
image.setAttribute("id", this.getAttribute("id"));
image.setAttribute("loading", "lazy");
image.setAttribute("original-src", originalURL);
this.appendChild(image);
this.setAttribute("id", "");
if(!(this.getAttribute("data-noPreview") === "true")) {
image.onclick = () => {
const instance = basicLightbox.create(`