lukehaas / Scrollify

A jQuery plugin that assists scrolling and snaps to sections.
MIT License
1.8k stars 580 forks source link

Shouldn't 'destroy' reset the 'firstLoad' flag? #389

Open vishnurk opened 5 years ago

vishnurk commented 5 years ago

I am attempting to destroy an existing Scrollify instance before re-initializing. On re-initializing, the 'afterRender' callback is NOT triggered. Took a closer look at code and noticed this - if(firstLoad===true) { settings.afterRender(); firstLoad = false; } Shouldn't the call to destroy reset the value of firstLoad to TRUE? I do see other variables getting reset.

lukehaas commented 5 years ago

Yes, looks like the destroy method should probably set firstLoad back to true. If you raise a PR for this, I'll be happy to merge it in.