removed debug console logs
parent
4d02ed130f
commit
9b8f224e14
|
@ -120,7 +120,7 @@ function focusVisiblePolyfill() {
|
|||
}
|
||||
|
||||
function pauseAllMedia() {
|
||||
console.log('Pausing all media');
|
||||
//console.log('Pausing all media');
|
||||
|
||||
document.querySelectorAll('.js-youtube').forEach((video) => {
|
||||
video.contentWindow.postMessage('{"event":"command","func":"' + 'pauseVideo' + '","args":""}', '*');
|
||||
|
@ -135,7 +135,7 @@ function pauseAllMedia() {
|
|||
}
|
||||
|
||||
function pauseAllMediaInGallery(gallery) {
|
||||
console.log('Pausing all media in gallery');
|
||||
//console.log('Pausing all media in gallery');
|
||||
|
||||
gallery.querySelectorAll('.js-youtube').forEach((video) => {
|
||||
video.contentWindow.postMessage('{"event":"command","func":"' + 'pauseVideo' + '","args":""}', '*');
|
||||
|
@ -610,7 +610,7 @@ class DeferredMedia extends HTMLElement {
|
|||
}
|
||||
|
||||
loadContent(focus = true) {
|
||||
console.log('Loading content');
|
||||
//console.log('Loading content');
|
||||
window.pauseAllMedia();
|
||||
if (!this.getAttribute('loaded')) {
|
||||
const content = document.createElement('div');
|
||||
|
@ -1065,15 +1065,15 @@ class VariantSelects extends HTMLElement {
|
|||
}
|
||||
}*/
|
||||
|
||||
console.log('this.currentVariant.featured_image', this.currentVariant.featured_image);
|
||||
console.log('this.currentVariant.featured_image.alt', this.currentVariant.featured_image.alt);
|
||||
//console.log('this.currentVariant.featured_image', this.currentVariant.featured_image);
|
||||
//console.log('this.currentVariant.featured_image.alt', this.currentVariant.featured_image.alt);
|
||||
|
||||
if (this.currentVariant.featured_image && this.currentVariant.featured_image.alt) {
|
||||
// just for info: document.querySelectorAll('[thumbnail-alt = '${test}']') // to select all elements with the alt tag
|
||||
|
||||
// only show the image with the alt tag that matches the variant title
|
||||
document.querySelectorAll('[thumbnail-alt]').forEach((thumbnail) => {
|
||||
console.log(thumbnail.getAttribute('thumbnail-alt'));
|
||||
//console.log(thumbnail.getAttribute('thumbnail-alt'));
|
||||
if (thumbnail.getAttribute('thumbnail-alt') === this.currentVariant.featured_image.alt) {
|
||||
thumbnail.style.display = 'block';
|
||||
} else {
|
||||
|
@ -1083,7 +1083,7 @@ class VariantSelects extends HTMLElement {
|
|||
);
|
||||
|
||||
document.querySelectorAll('[thumbnail-alt-mobile]').forEach((thumbnail) => {
|
||||
console.log(thumbnail.getAttribute('thumbnail-alt-mobile'));
|
||||
//console.log(thumbnail.getAttribute('thumbnail-alt-mobile'));
|
||||
if (thumbnail.getAttribute('thumbnail-alt-mobile') === this.currentVariant.featured_image.alt) {
|
||||
// check if has class "is-active" to show the image
|
||||
if (thumbnail.classList.contains('is-active') === false) {
|
||||
|
@ -1161,7 +1161,7 @@ class VariantSelects extends HTMLElement {
|
|||
}
|
||||
|
||||
updateMedia() {
|
||||
console.log('updateMedia', this.currentVariant);
|
||||
//console.log('updateMedia', this.currentVariant);
|
||||
|
||||
if (!this.currentVariant) return;
|
||||
if (!this.currentVariant.featured_media) return;
|
||||
|
@ -1171,16 +1171,16 @@ class VariantSelects extends HTMLElement {
|
|||
//mediaGallery.setActiveMedia(`${this.dataset.section}-${this.currentVariant.featured_media.id}`, true);
|
||||
|
||||
// how to get second image id from the gallery
|
||||
console.log('mediaGallery', mediaGallery);
|
||||
//console.log('mediaGallery', mediaGallery);
|
||||
|
||||
// get the second image id
|
||||
const galleryImages = mediaGallery.querySelectorAll('.thumbnail-list__item');
|
||||
|
||||
console.log('mediaGallery.elements.thumbnails', mediaGallery.elements.thumbnails);
|
||||
//console.log('mediaGallery.elements.thumbnails', mediaGallery.elements.thumbnails);
|
||||
|
||||
for (const galleryImage of galleryImages) {
|
||||
// if display is not none, then show the image
|
||||
console.log("galleryImage.getAttribute('thumbnail-alt')", galleryImage.getAttribute('thumbnail-alt'));
|
||||
//console.log("galleryImage.getAttribute('thumbnail-alt')", galleryImage.getAttribute('thumbnail-alt'));
|
||||
if (galleryImage.getAttribute('thumbnail-alt') === this.currentVariant.featured_image.alt) {
|
||||
|
||||
// check if galleryImage has data-is-video-type attribute
|
||||
|
@ -1188,7 +1188,7 @@ class VariantSelects extends HTMLElement {
|
|||
continue;
|
||||
}*/
|
||||
|
||||
console.log('galleryImage.dataset', galleryImage.dataset);
|
||||
//console.log('galleryImage.dataset', galleryImage.dataset);
|
||||
|
||||
const target = galleryImage.dataset.target; // "template--22806669590804__main-38794319626516"
|
||||
//const targetId = target.split('__')[1]; // "main-38794319626516"
|
||||
|
@ -1196,7 +1196,7 @@ class VariantSelects extends HTMLElement {
|
|||
|
||||
//setTimeout(() => {
|
||||
//mediaGallery.setActiveMedia(`${this.dataset.section}-${targetIdSplit}`, true);
|
||||
console.log('mediaGallery.setActiveThumbnail', target);
|
||||
//console.log('mediaGallery.setActiveThumbnail', target);
|
||||
mediaGallery.setActiveMedia(target, true);
|
||||
//}, 1000);
|
||||
|
||||
|
|
Loading…
Reference in New Issue