 # input elements. This mechanism allows us to decide whether to scroll a div or to scroll the whole document.
 #
 activatedElement = null
-settings = null
 
 scrollProperties =
   x: {


    element = findScrollableElement activatedElement, direction, pos
    amount = getDimension(element,direction,pos) - element[scrollProperties[direction].axisName]
    doScrollBy element, direction, amount

root = exports ? window
root.Scroller = Scroller


Scroller =
  init: (frontendSettings) ->
    handlerStack.push DOMActivate: -> activatedElement = event.target
    CoreScroller.init frontendSettings

  # scroll the active element in :direction by :amount * :factor.
  # :factor is needed because :amount can take on string values, which scrollBy converts to element dimensions.
