Skip to content

Commit 81e792f

Browse files
committed
Remove window globals and only return the instance from the ParallaxController init method.
1 parent 5111f4e commit 81e792f

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/libs/ParallaxController.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -385,20 +385,16 @@ function ParallaxController() {
385385
this.destroy = function() {
386386
_removeListeners();
387387
_removeParallaxStyles();
388-
window.ParallaxController = null;
389388
};
390389
}
391390

392391
/**
393392
* Static method to instantiate the ParallaxController.
394-
* Returns a new or existing instance of the ParallaxController.
393+
* Returns a new instance of the ParallaxController.
395394
* @returns {Object} ParallaxController
396395
*/
397396
ParallaxController.init = function() {
398-
if (!window.ParallaxController) {
399-
window.ParallaxController = new ParallaxController();
400-
}
401-
return window.ParallaxController;
397+
return new ParallaxController();
402398
};
403399

404400
export default ParallaxController;

0 commit comments

Comments
 (0)