       callback?()
 
 
-  scrollToSubView:(subView)->
+  scrollToSubView: (subView) ->
 
     viewTop       = @getY()
     viewHeight    = @getHeight()

    subViewHeight = subView.getHeight()
    subViewRelTop = subViewTop - viewTop + viewScrollTop

    # log "item is in visible area"
    if subViewTop - viewTop + subViewHeight < viewHeight and subViewTop - viewTop >= 0
      # log "item is in visible area"
      return

    # log "item is above visible area"
    else if subViewTop - viewTop < 0
      @scrollTo top : subViewRelTop

    # log "item is below visible area"
    else if subViewTop - viewTop + subViewHeight > viewHeight
      @scrollTo top : subViewRelTop - viewHeight + subViewHeight



module.exports = class KDScrollView extends KDView

  constructor: (options = {}, data) ->

    options.bind     = KD.utils.curry 'wheel scroll', options.bind
    options.cssClass = KD.utils.curry 'kdscrollview', options.cssClass
