This repository was archived by the owner on Sep 8, 2020. It is now read-only.
Reset the scrollpoint in response to a broadcasted event #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We'd like to use ui-scrollpoint to pin our menu to the top of the screen after the user scrolls past an ad (and show the ad again when the user scrolls back to the top of the page).
Unfortunately, there can be glitches when the ad is hidden or shown because of some other event, (such as window resizing) while the ui-scrollpoint attribute is active. In particular, the value of fixLimit may be wrong after external changes.
This pull request solves the problem by resetting in response to an event, if we also broadcast the appropriate event when necessary (in our case, on window resize, but it could be anything).
Unfortunately, I wasn't able to write a test that I thought adequately tested the new code--if someone can give me a hand with the tests, I'd appreciate it! I wouldn't want this merged without the tests, of course.