Skip to content

Commit

Permalink
Add event on ce_text image
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansl committed Sep 29, 2019
1 parent df18720 commit 732f629
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/Resources/contao/templates/js_lightgallery.html5
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<?php
// Add the lightgallery style sheet
$GLOBALS['TL_CSS'][] = 'bundles/clickpresslightgallery/lightgallery.js/css/lightgallery.min.css|static';
$GLOBALS['TL_CSS'][] = 'bundles/clickpresslightgallery/lightgallery.js/css/lightgallery.css|static';
?>

<script src="bundles/clickpresslightgallery/lightgallery.js/js/lightgallery.min.js"></script>
<script>
window.addEventListener('load', function() {
var gallery = document.querySelectorAll('.ce_gallery'),
image = document.querySelectorAll('.ce_image')
image = document.querySelectorAll('.ce_image'),
ceText = document.querySelectorAll('.ce_text .image_container');

gallery.forEach(function(element, index, array) {
lightGallery(element, {
Expand All @@ -16,12 +17,19 @@ window.addEventListener('load', function() {
selector: 'a'
})
})
image.forEach(function(element, index, array) {
ceText.forEach(function(element, index, array) {
lightGallery(element, {
download: false,
thumbnail: false,
selector: 'a'
})
})
image.forEach(function(element, index, array) {
lightGallery(element,{
download: false,
thumbnail: false,
selector: 'a'
})
})
})
</script>

0 comments on commit 732f629

Please sign in to comment.