Commit 45f9cca9b30c4f3f57d5abfc01b347adbc3ce34b
1 parent
98cf0ae3
Exists in
master
and in
4 other branches
Unbind document scroll on page:fetch to disable endlessScroll on pages where it is not used
Showing
1 changed file
with
4 additions
and
0 deletions
Show diff stats
app/assets/javascripts/main.js.coffee
| ... | ... | @@ -50,7 +50,11 @@ window.startSpinner = -> |
| 50 | 50 | window.stopSpinner = -> |
| 51 | 51 | $('.turbolink-spinner').fadeOut() |
| 52 | 52 | |
| 53 | +window.stopEndlessScroll = -> | |
| 54 | + $(document).unbind('scroll') | |
| 55 | + | |
| 53 | 56 | document.addEventListener("page:fetch", startSpinner) |
| 57 | +document.addEventListener("page:fetch", stopEndlessScroll) | |
| 54 | 58 | document.addEventListener("page:receive", stopSpinner) |
| 55 | 59 | |
| 56 | 60 | $ -> | ... | ... |