Skip to content
Snippets Groups Projects
Commit fbb8ab4b authored by Matthias Adrowski's avatar Matthias Adrowski
Browse files

Merge remote-tracking branch 'origin/master' into feature_Upgrade-to-TYPO3-11

parents 73daa310 20b0048f
No related branches found
No related tags found
1 merge request!3Feature upgrade to typo3 11
'use strict';
import LightboxManager from 'lightboxManager';
export default class SgVimeoLightbox {
/**
* Initializes the LightboxManager with the necessary parameters.
*/
......@@ -12,13 +9,16 @@ export default class SgVimeoLightbox {
const isMobile = window.matchMedia('(max-width: 679px)').matches;
vimeoItems.forEach((item) => {
if (item.dataset.disableLightboxMobile === '1' && isMobile || item.dataset.disableLightbox === '1' && !isMobile) {
if (
(item.dataset.disableLightboxMobile === '1' && isMobile) ||
(item.dataset.disableLightbox === '1' && !isMobile)
) {
item.classList.remove('sg-vimeo-item');
item.addEventListener('click', this.disableLightbox.bind(this));
}
});
LightboxManager.init({type: 'video', glightbox: {selector: '.sg-vimeo-item'}});
LightboxManager.init({ type: 'video', glightbox: { selector: '.sg-vimeo-item' } });
}
disableLightbox(event) {
......@@ -35,7 +35,7 @@ export default class SgVimeoLightbox {
iframe.width = width;
iframe.height = height;
iframe.style.border = 'none';
iframe.src = `https://player.vimeo.com/video/${videoId}?dnt=1`;
iframe.src = `https://player.vimeo.com/video/${videoId}?dnt=1&autoplay=1`;
iframe.allowFullscreen = true;
item.replaceChild(iframe, videoImage);
......@@ -46,4 +46,3 @@ export default class SgVimeoLightbox {
return splitUrl[splitUrl.length - 1];
}
}
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