website/ts/imgPreview.ts
2021-02-28 11:58:57 +01:00

7 lines
No EOL
340 B
TypeScript

let images:HTMLCollectionOf<HTMLImageElement> = <HTMLCollectionOf<HTMLImageElement>> document.getElementsByTagName("img");
for(let i = 0; i < images.length; i++){
let element:HTMLImageElement = images[i];
if(element.getAttribute("data-noPreview") === "true") {
element.onclick = () => createDialogImage(element.src);
}
}