mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-22 21:40:08 +00:00
Adding basic message-event
This commit is contained in:
parent
ff56eac276
commit
fc561804f9
@ -16,6 +16,7 @@ TimWolla.WCF ?= {}
|
||||
title: document.title
|
||||
messageTemplate: null
|
||||
newMessageCount: null
|
||||
events: { newMessage: $.Callbacks() }
|
||||
init: () ->
|
||||
@bindEvents()
|
||||
@refreshRoomList()
|
||||
@ -175,6 +176,8 @@ TimWolla.WCF ?= {}
|
||||
###
|
||||
handleMessages: (messages) ->
|
||||
for message in messages
|
||||
@events.newMessage.fire message
|
||||
|
||||
output = @messageTemplate.fetch message
|
||||
li = $ '<li></li>'
|
||||
li.addClass 'chatMessage chatMessage'+message.type
|
||||
|
Loading…
Reference in New Issue
Block a user