b27f285a |
Xmpp.Views.Contacts ||= {}
class Xmpp.Views.Contacts.ContactView extends Backbone.View
template: JST["backbone/templates/contacts/contact"] |
52ef7688 |
tagName: 'li'
className: 'clear user' |
b27f285a |
# events:
# 'click li.user': 'something'
initialize: () ->
_.bindAll(this)
|
52ef7688 |
# Patrim nejakemu zoznamu
@parentList = @attributes['listView'] |
b27f285a |
|
52ef7688 |
@model.on('change', @updateContact, this)
updateContact: (contact) ->
@model = contact |
b27f285a |
@render()
render: ->
contact = @model.toJSON() |
52ef7688 |
$(@el).html(@template(contact))
return this |