Skip to content

Commit

Permalink
set random UUID if not gallery
Browse files Browse the repository at this point in the history
  • Loading branch information
fritzmg committed Nov 28, 2023
1 parent 7d284f6 commit 686123f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions contao/templates/js_glightbox.html5
Expand Up @@ -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({
Expand Down

0 comments on commit 686123f

Please sign in to comment.