       @render ->
         @saveSnapshot()
         if @snapshotRestored = @controller.restoreSnapshotForLocation(@location)
-          @scrollToRestoredPosition()
+          @performScroll()
           @adapter.visitSnapshotRestored?(this)
           @complete() unless @shouldIssueRequest()
 

        @saveSnapshot()
        if @request.failed
          @controller.loadErrorResponse(@response)
          @scrollToTop()
          @adapter.visitResponseLoaded?(this)
          @fail()
        else
          @controller.loadResponse(@response)
          @scrollToAnchor()
          @adapter.visitResponseLoaded?(this)
          @complete()



  # Scrolling

  performScroll: ->
    unless @scrolled
      if @action is "restore"
        @scrollToRestoredPosition() or @scrollToTop()
      else
        @scrollToAnchor() or @scrollToTop()
      @scrolled = true

  scrollToRestoredPosition: ->
    position = @restorationData?.scrollPosition
    if position?
      @controller.scrollToPosition(position)
      true

  scrollToAnchor: ->
    if @location.anchor?
      @controller.scrollToAnchor(@location.anchor)
      true

  scrollToTop: ->
    @controller.scrollToPosition(x: 0, y: 0)

  # Private

