         })
 
 
-
-  onNavigateToHome: (e, text, status, res, xhr) =>
+  onNavigateToHome: (e, popState) =>
     e.preventDefault()
 
     # abort if already on home page
-    unless @currentPageId is @DEFAULT_ID
+    unless @currentPageId is @HOMEPAGE_ID
       @calculateY()
 
       # show and prepare hero outside of viewport

    # hook up scrolling logic before showing new page
    @$content.on('pjax:beforeReplace', @onHideHero)
    @$content.on('pjax:beforeReplace', @onHideContent)
    @$content.on('pjax:success', @onShowContent)
    @$content.on('pjax:success', @onUpdateBodyPageId)
    @$content.on('pjax:success', @onLoadCallback)


  onUpdateBodyPageId:  (e, text, status, res, xhr, t) =>
    i = xhr.url.lastIndexOf('/')
    pageId = xhr.url.slice(i + 1)

    @$body.removeClass('page-' + @currentPageId)

    if pageId
      @currentPageId = pageId
    else
      @currentPageId = @DEFAULT_ID

    @$body.addClass('page-' + @currentPageId)


  calculateY: =>

        onComplete: =>
          @$hero.addClass('hero--hidden')
      })
    else if @getPageIdFromUrl(options.url) is @HOMEPAGE_ID
      console.log('show homepage !!!!!')


  onHideContent: (e, contents, options) =>
    # hide content, unless we are going back to home page which slides out instead
    unless @getPageIdFromUrl(options.url) is @HOMEPAGE_ID
      TweenLite.set(@$content[0], {
        display: 'none'
      })


  onUpdateBodyPageId: (e, unused, options) =>
    pageId = @getPageIdFromUrl(options.url)
    @$body.removeClass('page-' + @currentPageId)

    if pageId
      @currentPageId = pageId
    else
      @currentPageId = @HOMEPAGE_ID

    @$body.addClass('page-' + @currentPageId)


  onShowContent: (e, unused, options) =>
    # don't run when going back to home page
    unless @getPageIdFromUrl(options.url) is @HOMEPAGE_ID
      # long transition when coming from the home page
      if @currentPageId is @HOMEPAGE_ID
        TweenLite.fromTo(@$content[0], 0.8, {
          y: @yTo
          display: 'block'
