From 686123fb8e561074c2b280a3014c33c518e535dd Mon Sep 17 00:00:00 2001 From: Fritz Michael Gschwantner Date: Tue, 28 Nov 2023 10:01:53 +0000 Subject: [PATCH] set random UUID if not gallery --- contao/templates/js_glightbox.html5 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contao/templates/js_glightbox.html5 b/contao/templates/js_glightbox.html5 index 41a759c..ac233da 100644 --- a/contao/templates/js_glightbox.html5 +++ b/contao/templates/js_glightbox.html5 @@ -12,6 +12,8 @@ echo Template::generateScriptTag('bundles/contaoglightbox/js/glightbox.min.js', document.querySelectorAll('a[data-lightbox]').forEach((element) => { if (!!element.dataset.lightbox) { element.setAttribute('data-gallery', element.dataset.lightbox); + } else { + element.setAttribute('data-gallery', crypto.randomUUID()); } }); GLightbox({