@@ -60,28 +60,28 @@ export default Base.extend({
6060 bottom : dom . get_css_value ( this . el , "bottom" , true ) ,
6161 left : dom . get_css_value ( this . el , "left" , true ) ,
6262 } ;
63- const intersection_observer_config_y = {
63+ const intersection_observer_config = {
6464 threshold : [ 1 , 0.99 , 0.97 , 0.96 , 0.95 , 0.94 , 0.93 , 0.92 , 0.91 , 0.9 ] ,
65- root : scroll_container_y ,
6665 // add margin as inverted sticky positions.
6766 rootMargin : `${ - pos . top - 1 } px ${ - pos . right - 1 } px ${ - pos . bottom - 1 } px ${ - pos . left - 1 } px` , // prettier-ignore
6867 } ;
6968
7069 const observer_y = new IntersectionObserver (
7170 this . _intersection_observer_callback . bind ( this ) ,
72- intersection_observer_config_y
71+ {
72+ ...intersection_observer_config ,
73+ root : scroll_container_y ,
74+ }
7375 ) ;
7476 observer_y . observe ( this . el ) ;
7577
7678 if ( scroll_container_x !== scroll_container_y ) {
77- const intersection_observer_config_x = Object . assign (
78- { } ,
79- intersection_observer_config_y ,
80- { root : scroll_container_x }
81- ) ;
8279 const observer_x = new IntersectionObserver (
8380 this . _intersection_observer_callback . bind ( this ) ,
84- intersection_observer_config_x
81+ {
82+ ...intersection_observer_config ,
83+ root : scroll_container_x ,
84+ }
8585 ) ;
8686 observer_x . observe ( this . el ) ;
8787 }
0 commit comments