Xmpp.Views.Popup ||= {}

class Xmpp.Views.Popup.PopupView extends Backbone.View
  superTemplate: JST["backbone/templates/popup/popup"]
  el: $('#js-popup')

  superEvents:
    'click .close': 'close'

  render: (childHtml) ->
    $(@el).html(@superTemplate()).append(childHtml)

  close: (e) ->
    e.preventDefault()
    @remove()

  remove: ->
    @stopListening()
    $(@el).empty()