From 50689d2b8322b8696fd3e50e0f61f9f7d83e7dab Mon Sep 17 00:00:00 2001 From: Jonas Leder <jonas@jonasled.de> Date: Sun, 1 May 2022 13:01:34 +0200 Subject: [PATCH] apply id from jl-img to inner image element --- js/customElements/image.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/customElements/image.js b/js/customElements/image.js index e2bdb80..e05f79a 100644 --- a/js/customElements/image.js +++ b/js/customElements/image.js @@ -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(` -- GitLab