Skip to content
Snippets Groups Projects
Commit 08f4a88a authored by Fabian Galinski's avatar Fabian Galinski :pouting_cat:
Browse files

[FEATURE] Show the lightbox on mobile devices

parent 934cdf7a
No related branches found
No related tags found
No related merge requests found
......@@ -13,8 +13,9 @@ module.exports = function() {
*/
function init() {
$('.sg-youtube-item').each(function (index, item) {
let $youtubeItem = $(item);
if ($youtubeItem.data('disable-lightbox')) {
let $youtubeItem = $(item),
viewportWidth = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);
if ($youtubeItem.data('disable-lightbox') && viewportWidth >= 680) {
$youtubeItem.on('click', replaceThumbnailWithVideo);
} else {
$youtubeItem.magnificPopup({
......
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