$().ready(->
  $(window).resize( ->
    App.UI.setAutoHeight()
  ).trigger('resize')

  Backbone.Events.on('resizeWorkspace', -> App.UI.setAutoHeight())

  $('#js-search-contacts').keyup( ->
    searchTerm = $(this).val()
    App.UI.filterContacts(searchTerm)
  )

#  $('.chat-alert').on('click', '.close', (e) ->
#    e.preventDefault()
#    $('.chat-alert').fadeOut(250, -> $(this).html(''))
#  )

  $('#add-contact').click((e) ->
    e.preventDefault()
    $('#js-popup .close').click()
    popup = new Xmpp.Views.Popup.AddContactView()
    popup.render()
  )
)