Commit be26d2724bc710bdc0cb2327830aff84ce61fba2

Authored by Dmitriy Zaporozhets
1 parent c3c84992

Unbind all document.on click/scroll after page fetch

Showing 1 changed file with 4 additions and 2 deletions   Show diff stats
app/assets/javascripts/main.js.coffee
... ... @@ -50,11 +50,13 @@ window.startSpinner = ->
50 50 window.stopSpinner = ->
51 51 $('.turbolink-spinner').fadeOut()
52 52  
53   -window.stopEndlessScroll = ->
  53 +window.unbindEvents = ->
54 54 $(document).unbind('scroll')
  55 + $(document).off('scroll')
  56 + $(document).off('click')
55 57  
56 58 document.addEventListener("page:fetch", startSpinner)
57   -document.addEventListener("page:fetch", stopEndlessScroll)
  59 +document.addEventListener("page:fetch", unbindEvents)
58 60 document.addEventListener("page:receive", stopSpinner)
59 61  
60 62 $ ->
... ...