App.ApplicationView = Ember.View.extend
  didInsertElement: ->
    $('.main-section').css 'min-height', ($(window).height() - $('.tab-bar:first').outerHeight())

    $('.toggle-side-menu,.side-menu').click ->
      menu = $('aside.side-menu')
      toggle = $('.toggle-side-menu')
      if menu.is(':visible')
        menu.animate left: -255, -> $(@).hide()
        toggle.animate left: 0, -> $(@).removeClass('open')
      else
        menu.show().animate left: 0
        toggle.animate left: 222 - 30, -> $(@).addClass('open')

    $(document).foundation()
