test
parent
6c936a3e44
commit
d472acd10c
|
@ -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 %}
|
Loading…
Reference in New Issue