From d8dd564b06a9ba16212d1848dbd2fd0a96b6737a Mon Sep 17 00:00:00 2001 From: damencho Date: Wed, 14 Sep 2016 15:22:36 -0500 Subject: [PATCH] Fixes clearing message counter on opening the chat. --- modules/UI/side_pannels/chat/Chat.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/UI/side_pannels/chat/Chat.js b/modules/UI/side_pannels/chat/Chat.js index f5d2ba011..8e62c851f 100644 --- a/modules/UI/side_pannels/chat/Chat.js +++ b/modules/UI/side_pannels/chat/Chat.js @@ -172,8 +172,11 @@ var Chat = { }; usermsg.autosize({callback: onTextAreaResize}); - $("#" + CHAT_CONTAINER_ID).bind("shown", - function () { + eventEmitter.on(UIEvents.SIDE_TOOLBAR_CONTAINER_TOGGLED, + function(containerId, isVisible) { + if (containerId !== CHAT_CONTAINER_ID || !isVisible) + return; + unreadMessages = 0; updateVisualNotification(); });