Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events don't get called when doing a recalc() #51

Open
caillou opened this issue May 7, 2014 · 0 comments
Open

Events don't get called when doing a recalc() #51

caillou opened this issue May 7, 2014 · 0 comments

Comments

@caillou
Copy link
Contributor

caillou commented May 7, 2014

Say you element is_stuck and you do the following thing:

  1. window.scroll(0,0)
  2. $(document.body).trigger('sticky_kit:recalc')

Then the following event does not get triggered: sticky_kit:unstick.

A quick hack would be to tick() before a recalc() as follows:

recalc_and_tick = ->
  tick()
  recalc()
  tick()

Obviously this is a really dirty hack. I am not sure how this can be solved right now. The problem comes from the fact that we do a fixed = false when setting the restore variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant