diff --git a/source/js/gallery.js b/source/js/gallery.js deleted file mode 100644 index 6c3611b..0000000 --- a/source/js/gallery.js +++ /dev/null @@ -1,21 +0,0 @@ -document.addEventListener('DOMContentLoaded', () => { - $('.article img:not(".not-gallery-item")').each(function() { - // wrap images with link and add caption if possible - if ($(this).parent('a').length === 0) { - $(this).wrap(''); - if (this.alt) { - $(this).after('

' + this.alt + '

'); - } - } - }); - - if (typeof $.fn.lightGallery === 'function') { - $('.article').lightGallery({ selector: '.gallery-item' }); - } - if (typeof $.fn.justifiedGallery === 'function') { - if ($('.justified-gallery > p > .gallery-item').length) { - $('.justified-gallery > p > .gallery-item').unwrap(); - } - $('.justified-gallery').justifiedGallery(); - } -}); diff --git a/source/js/main.js b/source/js/main.js index 87081a3..4f5a9ae 100644 --- a/source/js/main.js +++ b/source/js/main.js @@ -1,5 +1,25 @@ /* eslint-disable node/no-unsupported-features/node-builtins */ (function($, moment, ClipboardJS, config) { + $('.article img:not(".not-gallery-item")').each(function() { + // wrap images with link and add caption if possible + if ($(this).parent('a').length === 0) { + $(this).wrap(''); + if (this.alt) { + $(this).after('

' + this.alt + '

'); + } + } + }); + + if (typeof $.fn.lightGallery === 'function') { + $('.article').lightGallery({ selector: '.gallery-item' }); + } + if (typeof $.fn.justifiedGallery === 'function') { + if ($('.justified-gallery > p > .gallery-item').length) { + $('.justified-gallery > p > .gallery-item').unwrap(); + } + $('.justified-gallery').justifiedGallery(); + } + if (!$('.columns .column-right-shadow').children().length) { $('.columns .column-right-shadow').append($('.columns .column-right').children().clone()); }