pull/1/head
Jan Umbach 2024-05-30 22:57:39 +02:00
parent 6c936a3e44
commit d472acd10c
1 changed files with 12 additions and 0 deletions

View File

@ -111,6 +111,18 @@
videos.forEach(video => new ShxVideo(video));
});
// watch out for new video elements with class "shx-video-card-product"
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')) {
new ShxVideo(node);
console.log('new video added', node);
}
});
});
});
</script>
{% endif %}