Skip to content

Commit 76aa542

Browse files
committed
Improve js, DEV-1111
1 parent a5d0483 commit 76aa542

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

view/frontend/web/js/slide-widget-mixin.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,15 @@ define([
4949
videoElement.setAttribute('data-video-src', videoElement.getAttribute('data-cookieblock-src'));
5050
videoElement.style.display = 'block';
5151
videoElement.removeAttribute('data-cookieblock-src');
52-
videoElement.closest('.custom-slide-uwt').querySelector('.cookieconsent-optout-marketing').remove();
52+
53+
// Safely remove the consent blocker element with null checks
54+
const customSlide = videoElement.closest('.custom-slide-uwt');
55+
if (customSlide) {
56+
const consentBlocker = customSlide.querySelector('.cookieconsent-optout-marketing');
57+
if (consentBlocker) {
58+
consentBlocker.remove();
59+
}
60+
}
5361
}
5462
videoElement.setAttribute('data-element-in-viewport', '.jarallax-viewport-element');
5563
videoElement.appendChild(viewportElement);

0 commit comments

Comments
 (0)