make img clickable to event details

This commit is contained in:
Stefan Bühler 2024-12-30 22:21:03 +01:00
parent 61d8457225
commit 9fdce50cbb

View File

@ -16,15 +16,23 @@ var AppointmentImage = {
const {item, settings} = vnode.attrs;
const image_url = item.base.image?.fileUrl ?? (is_mobile ? default_image_mobile : null) ?? settings.default_image;
return m(".cte-image",
image_url ? m(
let url = item.base.link;
if (url && !url.startsWith("http")) {
url = "https://" + url;
}
let img = image_url ? m(
"img",
{
src: image_url,
alt: item.base.caption,
},
) : null,
)
) : null;
if (img && url) {
img = m("a", {href: url}, img);
}
return m(".cte-image", img)
}
}