     else KDView.setElementClass html, 'remove', 'app'
 
     if isApp or name in appsWithDock
-    then @getView().showDock()
-    else @getView().hideDock()
+    then dock.getView().show()
+    else dock.getView().hide()

    mainView.on 'MainTabPaneShown', (pane) =>
      @mainTabPaneChanged mainView, pane

    appManager.on 'AppIsBeingShown', (controller)=>
      @setBodyClass KD.utils.slugify controller.getOption 'name'

    display.on 'ContentDisplayWantsToBeShown', do =>
      type = null
      (view)=>
        if type = view.getOption 'type'
          @setBodyClass type

    windowController.on 'ScrollHappened', do ->
      threshold     = 50
      lastScroll    = 0
      currentHeight = 0

      _.throttle (event)->
        el = document.body
        {scrollHeight, scrollTop} = el

        return  if scrollHeight <= window.innerHeight or scrollTop <= 0

        current = scrollTop + window.innerHeight
        if current > scrollHeight - threshold
          return if lastScroll > 0
          appManager.getFrontApp()?.emit "LazyLoadThresholdReached"
          lastScroll    = current
          currentHeight = scrollHeight
        else if current < lastScroll then lastScroll = 0

        if scrollHeight isnt currentHeight then lastScroll = 0
      , 200

  setBodyClass: do ->


      KDView.setElementClass body, 'add', name
      previousClass = name


  mainTabPaneChanged:(mainView, pane)->

