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

This commit is contained in:
Dmitriy Zaporozhets 2013-05-28 18:59:01 +03:00
parent 98cf0ae338
commit 45f9cca9b3

View file

@ -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)
$ -> $ ->