Skip to content
Snippets Groups Projects
Commit e95bfdc2 authored by Johannes Kreiner's avatar Johannes Kreiner
Browse files

[BUGFIX] Prevent unnecessary SgYouTubeLightbox reinitialization

parent 6cfee976
No related branches found
No related tags found
No related merge requests found
......@@ -11,8 +11,8 @@ module.exports = function() {
/**
* Initialize the whole Popup setup
*/
function init() {
$('.sg-youtube-item').each(function (index, item) {
function init(section) {
$(`${section || ''} .sg-youtube-item`).each(function (index, item) {
let $youtubeItem = $(item),
viewportWidth = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);
if (($youtubeItem.data('disable-lightbox') && viewportWidth >= 680) ||
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment