File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -36,15 +36,17 @@ function ParallaxController() {
3636 // Passive support
3737 const supportsPassive = testForPassiveScroll ( ) ;
3838
39+ function _addListeners ( ) {
40+ window . addEventListener ( 'scroll' , _handleScroll , supportsPassive ? { passive : true } : false ) ;
41+ window . addEventListener ( 'resize' , _handleResize , false ) ;
42+ }
43+
3944 function _removeListeners ( ) {
4045 window . removeEventListener ( 'scroll' , _handleScroll , supportsPassive ? { passive : true } : false ) ;
4146 window . removeEventListener ( 'resize' , _handleResize , false ) ;
4247 }
4348
44- function _addListeners ( ) {
45- window . addEventListener ( 'scroll' , _handleScroll , supportsPassive ? { passive : true } : false ) ;
46- window . addEventListener ( 'resize' , _handleResize , false ) ;
47- }
49+ _addListeners ( ) ;
4850
4951 /**
5052 * Window scroll handler sets the scrollY
@@ -351,9 +353,6 @@ function ParallaxController() {
351353 _removeParallaxStyles ( ) ;
352354 window . ParallaxController = null ;
353355 } ;
354-
355- // Initialize the Parallax scroll listener
356- _addListeners ( ) ;
357356}
358357
359358/**
You can’t perform that action at this time.
0 commit comments