     setTimeout shiftWindow, 100
 
 $ ->
+
+  $document = $(document)
+  $window   = $(window)
+  $body     = $('body')
+
   gl.utils.preventDisabledButtons()
   bootstrapBreakpoint = bp.getBreakpointSize()
 

  new Aside()

  # Sidenav pinning
  if $(window).width() < 1440 and $.cookie('pin_nav') is 'true'
    $.cookie('pin_nav', 'false', { path: '/' })
    $('.page-with-sidebar')
      .toggleClass('page-sidebar-collapsed page-sidebar-expanded')
      .removeClass('page-sidebar-pinned')
    $('.navbar-fixed-top').removeClass('header-pinned-nav')

  $(document)
    .off 'click', '.js-nav-pin'
    .on 'click', '.js-nav-pin', (e) ->
      e.preventDefault()

  $('.account-box').hover -> $(@).toggleClass('hover')

  # Commit show suppressed diff
  $document.on 'click', '.diff-content .js-show-suppressed-diff', ->
    $container = $(@).parent()
    $container.next('table').show()
    $container.remove()
