             breadcrumbs: breadcrumbs
 
         if @scrollWhenReady
-            offset = @$el.offset().top
-            $(window).scrollTop offset
+            @scrollToTop()
 
             # Only do it once
             @scrollWhenReady = false


        app.router.navigate "#task/#{ @collection.taskId }/files/#{ @collection.path }"

        @collection.reset()
        @collection.fetch()

        @render()

        $loaderContainer = @$ '.page-loader-container'
        if tableHeight?
            $loaderContainer.css 'height', "#{ tableHeight }px"

    catchAjaxError: ->
        @$('.span-12').html '<h3>Could not get files :(</h3>'

    scrollToTop: ->
        offset = @$el.offset().top
        $(window).scrollTop offset

    navigate: (event) ->
        event.preventDefault()

        $table = @$ 'table'
        # Get table height for later
