From 407b08278040482eb589d431eca5d1424b70a136 Mon Sep 17 00:00:00 2001 From: damencho Date: Wed, 14 Sep 2016 15:18:14 -0500 Subject: [PATCH] Removes changing the message icon and flashing on new message. --- modules/UI/side_pannels/chat/Chat.js | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/modules/UI/side_pannels/chat/Chat.js b/modules/UI/side_pannels/chat/Chat.js index ddd7ebe09..f5d2ba011 100644 --- a/modules/UI/side_pannels/chat/Chat.js +++ b/modules/UI/side_pannels/chat/Chat.js @@ -9,7 +9,6 @@ import UIEvents from '../../../../service/UI/UIEvents'; var smileys = require("./smileys.json").smileys; -var notificationInterval = false; var unreadMessages = 0; /** @@ -18,9 +17,9 @@ var unreadMessages = 0; var CHAT_CONTAINER_ID = "chat_container"; /** - * Shows/hides a visual notification, indicating that a message has arrived. + * Updates visual notification, indicating that a message has arrived. */ -function setVisualNotification(show) { +function updateVisualNotification() { var unreadMsgElement = document.getElementById('unreadMessages'); var glower = $('#toolbar_button_chat'); @@ -41,27 +40,9 @@ function setVisualNotification(show) { 'style', 'top:' + topIndent + '; left:' + leftIndent + ';'); - - if (!glower.hasClass('icon-chat-simple')) { - glower.removeClass('icon-chat'); - glower.addClass('icon-chat-simple'); - } } else { unreadMsgElement.innerHTML = ''; - glower.removeClass('icon-chat-simple'); - glower.addClass('icon-chat'); - } - - if (show && !notificationInterval) { - notificationInterval = window.setInterval(function () { - glower.toggleClass('active'); - }, 800); - } - else if (!show && notificationInterval) { - window.clearInterval(notificationInterval); - notificationInterval = false; - glower.removeClass('active'); } } @@ -194,7 +175,7 @@ var Chat = { $("#" + CHAT_CONTAINER_ID).bind("shown", function () { unreadMessages = 0; - setVisualNotification(false); + updateVisualNotification(); }); addSmileys(); @@ -214,7 +195,7 @@ var Chat = { if (!Chat.isVisible()) { unreadMessages++; UIUtil.playSoundNotification('chatNotification'); - setVisualNotification(true); + updateVisualNotification(); } }