make image popups work again for embeds

This commit is contained in:
MathMan05 2025-04-08 21:14:43 -05:00
parent 3ee271a345
commit 9a6ea8fc6d

View file

@ -173,9 +173,18 @@ class Embed {
generateImage() {
const img = createImg(this.json.thumbnail.proxy_url);
img.classList.add("messageimg");
img.onclick = function () {
img.onclick = () => {
const full = new ImagesDisplay([
new File({id: "", filename: "", url: img.src, size: -1, content_type: "image"}, null),
new File(
{
id: "",
filename: "",
url: this.json.thumbnail.proxy_url,
size: -1,
content_type: "image/",
},
null,
),
]);
full.show();
};
@ -212,7 +221,7 @@ class Embed {
img.classList.add("embedimg");
img.onclick = function () {
const full = new ImagesDisplay([
new File({id: "", filename: "", url: img.src, size: -1, content_type: "image"}, null),
new File({id: "", filename: "", url: img.src, size: -1, content_type: "image/"}, null),
]);
full.show();
};
@ -390,7 +399,7 @@ class Embed {
} else {
img.onclick = async () => {
const full = new ImagesDisplay([
new File({id: "", filename: "", url: img.src, size: -1, content_type: "image"}, null),
new File({id: "", filename: "", url: img.src, size: -1, content_type: "image/"}, null),
]);
full.show();
};