headroom.js
headroom.js copied to clipboard
Add beforePin and beforeUnpin actions
Fixes #96.
I'm still not sure about this. Don't want to complicate the API further with more callbacks, yet i can see the need/desire for this kind of functionality. I'll think it over this week (I plan on getting through as many issues/PRs as possible this week)
I like the idea, but I would find it better with an event based implementation. Something that would allow you to prevent the default, which would be the pin/unpin effect.
I'd love to see this merged as I too have a need for this functionality. In general I am also a fan of event-based approaches, but the callbacks get the job done just fine. :) If you were to switch to event-based it would be best to do that for all callbacks, which obviously would be a significant change, and thus one I recommend leaving until some future date (ie, go ahead and introduce the beforePin
, beforeUnpin
callbacks, and explore a possible events overhaul later).
I also could use this and will have to find a workaround in the mean time.
@WickyNilliams anything we can help with to get this in? I need this yet again on a different project now. It's been awhile, it might as well get merged then later handle the event emitter changes when those come around.