Unbind document scroll on page:fetch to disable endlessScroll on pages where it is not used
This commit is contained in:
parent
98cf0ae338
commit
45f9cca9b3
1 changed files with 4 additions and 0 deletions
|
@ -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)
|
||||||
|
|
||||||
$ ->
|
$ ->
|
||||||
|
|
Loading…
Reference in a new issue