Commit e95bfdc2 authored by Johannes Kreiner's avatar Johannes Kreiner
Browse files

[BUGFIX] Prevent unnecessary SgYouTubeLightbox reinitialization

parent 6cfee976
......@@ -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) ||
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment