Fixed bug where tabs change when another user joins the channel

This commit is contained in:
Kasper Rynning-Tønnesen
2016-04-20 12:54:22 +02:00
parent 68f998a69e
commit b4c3395b0d
4 changed files with 18 additions and 24 deletions

View File

@@ -37,14 +37,13 @@ var Chat = {
//$("#chat-btn").css("color", "grey");
console.log(inp.indexOf("changed name to"));
if(!blink_interval_exists && inp.indexOf("changed name to") < 0 && !chat_active)
{
$("#favicon").attr("href", "static/images/highlogo.png");
blink_interval_exists = true;
unseen = true;
blink_interval = setInterval(Chat.chat_blink, 2000);
chat_unseen = true;
//blink_interval = setTimeout(Chat.chat_blink, 2000);
}
if(document.hidden)
@@ -74,7 +73,8 @@ var Chat = {
{
$("#favicon").attr("href", "static/images/highlogo.png");
unseen = true;
blink_interval = setTimeout(Chat.chat_blink, 1000);
chat_unseen = true;
//blink_interval = setTimeout(Chat.chat_blink, 1000);
}
var color = Helper.intToARGB(Helper.hashCode(data[0]));
@@ -90,19 +90,6 @@ var Chat = {
$("#chatchannel li:last")[0].appendChild(in_text);
document.getElementById("chatchannel").scrollTop = document.getElementById("chatchannel").scrollHeight;
});
},
chat_blink: function()
{
console.log("chat_blink");
$(".chat-link").css("color", "red");
setTimeout(function(){
$(".chat-link").css("color", "white");
if(unseen){
Chat.chat_blink();
}
}, 1000);
}
}