app/assets/javascripts/backbone/views/popup/friend_request.coffee
910e0f23
 Xmpp.Views.Popup ||= {}
 
 class Xmpp.Views.Popup.FriendRequestView extends Xmpp.Views.Popup.PopupView
   template: JST["backbone/templates/popup/friend_request"]
0e8bb3a5
   className: 'friend-reqeust'
910e0f23
 
   events:
     'submit form': 'approve'
 
   initialize: (options) ->
     @name = options.name
     @jid  = options.jid
 
0e8bb3a5
     @events = _.extend(@events, @superEvents())
910e0f23
 
   render: ->
     super(@template(new_contact: @name))
     $(@el).css(width: '20%', 'z-index': 999)
     this
 
   approve: (e) ->
     e.preventDefault()
0e8bb3a5
     App.debug ['approve request', @jid]
910e0f23
     App.Com.answerFriendRequest(@jid, true)
0e8bb3a5
     @remove(e)
910e0f23
 
   close: (e) ->
     e.preventDefault()
0e8bb3a5
     App.debug ['cancel request', @jid]
910e0f23
     App.Com.answerFriendRequest(@jid, false)
0e8bb3a5
     @remove(e)