 
     @mainController.on "AccountChanged", @bound "decorate"
     @mainController.on "JoinedGroup", => @widget.show()
-    @mainController.on "NavigationLinkTitleClick", @bound "navigateHome"
 
-    # do =>
-    #   bindChangePage = => @on 'scroll', @bound "changePageToActivity"
-    #   if KD.isLoggedIn()
-    #   then do bindChangePage
-    #   else @mainController.once "AccountChanged", bindChangePage
-
-    @on 'scroll', @bound "changePageToActivity"
     @header.bindTransitionEnd()
 
     @feedWrapper.ready =>

      @widget.hide()
    @_windowDidResize()

  changePageToActivity:(event)->

    if KD.isLoggedIn()
      if not @$().hasClass("fixed") and @getScrollTop() > headerHeight - 10
        {navController} = @mainController.sidebarController.getView()
        navController.selectItemByName 'Activity'
        @setClass "fixed"
        @header.once "transitionend", @header.bound "hide"
        @header.$().css marginTop : -headerHeight
        KD.getSingleton('mainViewController').emit "browseRequested"

  navigateHome:(itemData)->

    switch itemData.pageName
      when "Home"
        @header.show()
        @header._windowDidResize()
        @scrollTo {duration : 300, top : 0}, =>
          # if KD.isLoggedIn()
          @unsetClass "fixed"
          @header.$().css marginTop : 0
      when "Activity"
        if KD.isLoggedIn()
          @header.once "transitionend", =>
            @header.hide()
            @setClass "fixed"
          @header.$().css marginTop : -headerHeight
        else
          @scrollTo {duration : 300, top : @header.getHeight()}

  _windowDidResize:->
    return unless @header

  viewAppended:->

    {entryPoint}      = KD.config
    HomeKonstructor   = if entryPoint and entryPoint.type isnt 'profile' then GroupHomeView else KDCustomHTMLView
    @feedWrapper      = new ActivityListContainer
    @innerNav         = new ActivityInnerNavigation cssClass : 'fl'
    @header           = new HomeKonstructor
