make img clickable to event details
This commit is contained in:
parent
61d8457225
commit
9fdce50cbb
@ -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(
|
||||
"img",
|
||||
{
|
||||
src: image_url,
|
||||
alt: item.base.caption,
|
||||
},
|
||||
) : null,
|
||||
)
|
||||
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;
|
||||
if (img && url) {
|
||||
img = m("a", {href: url}, img);
|
||||
}
|
||||
|
||||
return m(".cte-image", img)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user