baptistebriel / smooth-scrolling

smooth scrolling and parallax effects on scroll
MIT License
612 stars 75 forks source link

Check if 'extends' has been explicitly set as an option #82

Closed jamiemorganward closed 6 years ago

jamiemorganward commented 6 years ago

Hi @baptistebriel

I ran into an issue using this module in my webpack project with uglify because this.extends is set by checking if the constructor name is Smooth. In my situation, uglify was renaming the classname during the minification process which would mean the this.extends would be set to true, breaking the unextended class.

I think only relying on the class name isn't always reliable, so I think it would be helpful to provide the option to explicitly set it.

It also seems that in some of the demos, there's already an extends parameter, so this follows suit 🙂

baptistebriel commented 6 years ago

Hey @jamiemorganward, makes sense indeed. Thanks for the PR! Have a good week-end. :)