fix(gallery): unwrap <p> for justified gallery to work

This commit is contained in:
ppoffice 2019-08-05 23:54:24 -04:00
parent 2ebfaeb406
commit d150e555ce
1 changed files with 3 additions and 0 deletions

View File

@ -3,6 +3,9 @@ document.addEventListener('DOMContentLoaded', 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();
}
});