File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed
templates/theme-default/assets/js Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -183,10 +183,12 @@ function init(el) {
183
183
184
184
function getNextSlide ( direction = 1 ) {
185
185
let next =
186
- direction > 0 ? activeSlide . nextElementSibling || activeSlide : activeSlide . previousElementSibling || activeSlide ;
186
+ direction > 0
187
+ ? activeSlide ?. nextElementSibling || activeSlide
188
+ : activeSlide ?. previousElementSibling || activeSlide ;
187
189
188
190
for ( let i = 1 ; i < slidesPerGroup ; i ++ ) {
189
- next = direction > 0 ? next . nextElementSibling || next : next . previousElementSibling || next ;
191
+ next = direction > 0 ? next ? .nextElementSibling || next : next ? .previousElementSibling || next ;
190
192
}
191
193
192
194
return next ;
Original file line number Diff line number Diff line change @@ -22,16 +22,24 @@ if (supportsContainerQueries) {
22
22
const cvObserver = new IntersectionObserver ( ( entries , observer ) => {
23
23
entries . forEach ( ( entry ) => {
24
24
if ( entry . isIntersecting ) {
25
- entry . target . attributeStyleMap . set ( 'content-visibility' , 'visible' ) ;
25
+ entry . target . style . contentVisibility = 'visible' ;
26
26
observer . unobserve ( entry . target ) ;
27
27
}
28
28
} ) ;
29
29
} ) ;
30
30
31
31
const initialize = ( ) => {
32
32
Array . from ( document . querySelectorAll ( 'main img' ) ) . forEach ( ( el ) => cvObserver . observe ( el ) ) ;
33
- initVideo ( ) ;
34
- initSlider ( ) ;
33
+ try {
34
+ initVideo ( ) ;
35
+ } catch ( e ) {
36
+ console . log ( e ) ;
37
+ }
38
+ try {
39
+ initSlider ( ) ;
40
+ } catch ( e ) {
41
+ console . log ( e ) ;
42
+ }
35
43
} ;
36
44
37
45
// We need to retrigger initialize in storybook so we don't have to reload the page
You can’t perform that action at this time.
0 commit comments