Commit 45f9cca9 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Unbind document scroll on page:fetch to disable endlessScroll on pages where it is not used

parent 98cf0ae3
...@@ -50,7 +50,11 @@ window.startSpinner = -> ...@@ -50,7 +50,11 @@ window.startSpinner = ->
window.stopSpinner = -> window.stopSpinner = ->
$('.turbolink-spinner').fadeOut() $('.turbolink-spinner').fadeOut()
window.stopEndlessScroll = ->
$(document).unbind('scroll')
document.addEventListener("page:fetch", startSpinner) document.addEventListener("page:fetch", startSpinner)
document.addEventListener("page:fetch", stopEndlessScroll)
document.addEventListener("page:receive", stopSpinner) document.addEventListener("page:receive", stopSpinner)
$ -> $ ->
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment