pull/1/head
Jan Umbach 2024-05-31 11:01:18 +02:00
parent 924d48bda1
commit 9129ea9da0
1 changed files with 21 additions and 0 deletions

View File

@ -55,6 +55,27 @@
console.log(this);
this.video = this.querySelector('video');
if(!this.video) {
console.error('No video element found');
// create observer to watch for new video elements
const observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
mutation.addedNodes.forEach(function(node) {
if (node.classList && node.classList.contains('shx-video-card-product')) {
this.connectedCallback();
console.log('new video added', node);
}
}.bind(this));
}.bind(this));
}.bind(this));
return;
}
console.log("video",this.video);
// get parrent with class "card-wrapper product-card-wrapper"
this.productCard = this.video.closest('.product-card-wrapper');
console.log(this.productCard);