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,7 +50,11 @@ window.startSpinner = -> | ||
50 | window.stopSpinner = -> | 50 | window.stopSpinner = -> |
51 | $('.turbolink-spinner').fadeOut() | 51 | $('.turbolink-spinner').fadeOut() |
52 | 52 | ||
53 | +window.stopEndlessScroll = -> | ||
54 | + $(document).unbind('scroll') | ||
55 | + | ||
53 | document.addEventListener("page:fetch", startSpinner) | 56 | document.addEventListener("page:fetch", startSpinner) |
57 | +document.addEventListener("page:fetch", stopEndlessScroll) | ||
54 | document.addEventListener("page:receive", stopSpinner) | 58 | document.addEventListener("page:receive", stopSpinner) |
55 | 59 | ||
56 | $ -> | 60 | $ -> |