     elOffset = $el.offset().top
     elHeight = $el.height()
     windowHeight = $(window).height()
-    offset
 
     if elHeight < windowHeight
       offset = elOffset - ((windowHeight / 2) - (elHeight / 2))

    # view loses event delegation only on a channel.
    _.defer => @delegateEvents()

    if $('body').hasClass 'is-mobile'
      console.log 'delegating mobile events'
      @delegateEvents(@mobileEvents)

  startLoading: -> $('body').addClass 'is-loading'


      window.location = href

  scrollToTop: (e) ->
    e.preventDefault()
    e.stopPropagation()

    $("html, body").animate { scrollTop: 0 }, 300
