 reference = 0
 
 
+startScrolling = (e) ->
+  scrolling = true
+  reference = ypos e
+  max = parseInt(getComputedStyle(@root.firstChild).height) - window.innerHeight
+
+
+stopScrolling = ->
+  scrolling = false
+
+
 ###*
 # `touchstart` handler for scrollable view.
 #
 #
 ###
 onTouchStart = (e) ->
-  scrolling = true
-  reference = ypos e
-  max = parseInt(getComputedStyle(@root.firstChild).height) - window.innerHeight
+  startScrolling.call @, e
   e.preventDefault()
   e.stopPropagation()
   return

    @classes.add SCROLLABLE_CLS
    @addEventListener 'touchstart', onTouchStart, @
    @addEventListener 'touchend', onTouchEnd, @
    @addEventListener 'touchmove', onTouchMove, @

  e.preventDefault()
  e.stopPropagation()
  return



onWheel = (e) ->
  if wheelTimer then clearTimeout wheelTimer

  if not scrolling then startScrolling.call @, e

  wheelTimer = setTimeout ->
    stopScrolling()
  , WHEEL_TIME

  onMove.call @, e




