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
Tags 4.2.2
No related merge requests found
...@@ -11,8 +11,8 @@ module.exports = function() { ...@@ -11,8 +11,8 @@ module.exports = function() {
/** /**
* Initialize the whole Popup setup * Initialize the whole Popup setup
*/ */
function init() { function init(section) {
$('.sg-youtube-item').each(function (index, item) { $(`${section || ''} .sg-youtube-item`).each(function (index, item) {
let $youtubeItem = $(item), let $youtubeItem = $(item),
viewportWidth = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0); viewportWidth = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);
if (($youtubeItem.data('disable-lightbox') && viewportWidth >= 680) || 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