         document.getElementById('commits').innerHTML = data.html
         $('.js-timeago').timeago()
         @commitsLoaded = true
-        @scrollToElement(".commits")
+        @scrollToElement("#commits")
 
   loadDiff: (source) ->
     return if @diffsLoaded


  scrollToElement: (container) ->
    if window.location.hash
      top = $(container + " " + window.location.hash).offset().top
      $('body').scrollTo(top)

  # Activate a tab based on the current action
  activateTab: (action) ->

      success: (data) =>
        document.getElementById('diffs').innerHTML = data.html
        @diffsLoaded = true
        @scrollToElement("#diffs")

  # Show or hide the loading spinner
  #
