From fc561804f935538b5a64d5a7706f1ca268a7a9bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 27 Dec 2011 17:07:12 +0100 Subject: [PATCH] Adding basic message-event --- file/js/TimWolla.WCF.Chat.coffee | 3 +++ 1 file changed, 3 insertions(+) diff --git a/file/js/TimWolla.WCF.Chat.coffee b/file/js/TimWolla.WCF.Chat.coffee index 6614931..7e90398 100644 --- a/file/js/TimWolla.WCF.Chat.coffee +++ b/file/js/TimWolla.WCF.Chat.coffee @@ -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.addClass 'chatMessage chatMessage'+message.type