{if $media->isImage}
{if $thumbnailSize != 'original'}
{if !$removeLinks}
- <a href="{$mediaLink}" class="embeddedAttachmentLink jsImageViewer">
+ <a href="{$mediaLink}" class="embeddedAttachmentLink" data-fancybox="attachments">
{/if}
<img src="{$thumbnailLink}" alt="{$media->altText}" title="{$media->title}" width="{@$media->getThumbnailWidth($thumbnailSize)}" height="{@$media->getThumbnailHeight($thumbnailSize)}" loading="lazy">
{if !$removeLinks}
{foreach from=$uploadFieldFiles item=file}
<li class="box64 uploadedFile" data-unique-file-id="{$file->getUniqueFileId()}">
{if $file->isImage()}
- <a href="{$file->getImage()}" class="jsImageViewer">
+ <a href="{$file->getImage()}" data-fancybox>
<img src="{$file->getImage()}" width="{$file->getWidth()}" height="{$file->getHeight()}" loading="lazy" alt="" class="formUploadHandlerContentListImage">
</a>
{else}
if (file.link !== undefined && file.filename !== undefined) {
const link = document.createElement("a");
link.href = file.link!;
- link.classList.add("jsImageViewer");
+ link.dataset.fancybox = "attachments";
link.title = file.filename;
link.textContent = file.filename;
filenameLink.href = element.link;
filenameLink.title = element.filename;
filenameLink.textContent = element.filename;
- filenameLink.classList.add("jsImageViewer");
+ filenameLink.dataset.fancybox = "";
// Insert a hidden image element that will be used by the image viewer as the preview image
const previewImage = document.createElement("img");
if (fileData.image !== null) {
const a = document.createElement("a");
- a.classList.add("jsImageViewer");
+ a.dataset.fancybox = "";
a.href = fileData.image;
const image = document.createElement("img");
image.classList.add("formUploadHandlerContentListImage");
if (file.link !== undefined && file.filename !== undefined) {
const link = document.createElement("a");
link.href = file.link;
- link.classList.add("jsImageViewer");
+ link.dataset.fancybox = "attachments";
link.title = file.filename;
link.textContent = file.filename;
const filename = element.querySelector(".fileList__item__filename");
filenameLink.href = element.link;
filenameLink.title = element.filename;
filenameLink.textContent = element.filename;
- filenameLink.classList.add("jsImageViewer");
+ filenameLink.dataset.fancybox = "";
// Insert a hidden image element that will be used by the image viewer as the preview image
const previewImage = document.createElement("img");
previewImage.src = thumbnail !== undefined ? thumbnail.link : element.link;
const icon = fileElement.querySelector("fa-icon");
if (fileData.image !== null) {
const a = document.createElement("a");
- a.classList.add("jsImageViewer");
+ a.dataset.fancybox = "";
a.href = fileData.image;
const image = document.createElement("img");
image.classList.add("formUploadHandlerContentListImage");