         ease: Circ.easeInOut
         clearProps: 'all'
         onComplete: =>
-          # tell pjax to nav to home page
-          $.pjax({url: '/', container: @contentSelector, fragment: @contentSelector})
+          unless popState
+            # tell pjax to nav to home page
+            $.pjax({url: '/', container: @contentSelector, fragment: @contentSelector})
       })
 
       # transition content

        onComplete: =>
          @$hero.addClass('hero--hidden')
      })


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


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

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


  getPageIdFromUrl: (url) ->
    index = url.lastIndexOf("/")
    name = url.slice(index + 1)
    if name and name.length
      return name
    return @HOMEPAGE_ID

    # listen to popstate to know when to show hero
  onPopState: (e) =>
    if @getPageIdFromUrl(e.state.url) is @HOMEPAGE_ID
      console.log('POP home page')
      @onNavigateToHome(e, true)


  calculateY: =>
