Fix issue where chat increment would go up even if the chat box was in focus, makes sense, apologies this wasn't in first commit

This commit is contained in:
John McLear 2011-12-04 19:51:45 +00:00
parent 438bee7ef5
commit c230e3db2d

View file

@ -108,19 +108,23 @@ var chat = (function()
//should we increment the counter?? //should we increment the counter??
if(increment) if(increment)
{ {
var count = Number($("#chatcounter").text()); // Only increment if the chat window is not already open
count++; if(!$('#chattext').is(':visible'))
$("#chatcounter").text(count); {
// chat throb stuff -- Just make it throw for twice as long var count = Number($("#chatcounter").text());
if(wasMentioned) count++;
{ // If the user was mentioned show for twice as long and flash the browser window $("#chatcounter").text(count);
if (chatMentions == 0){ // chat throb stuff -- Just make it throw for twice as long
title = document.title; if(wasMentioned)
{ // If the user was mentioned show for twice as long and flash the browser window
if (chatMentions == 0){
title = document.title;
}
$('#chatthrob').html("<b>"+authorName+"</b>" + ": " + text);
$('#chatthrob').effect("pulsate", {times:1,mode:"hide"},4000);
chatMentions++;
document.title = "("+chatMentions+") " + title;
} }
$('#chatthrob').html("<b>"+authorName+"</b>" + ": " + text);
$('#chatthrob').effect("pulsate", {times:1,mode:"hide"},4000);
chatMentions++;
document.title = "("+chatMentions+") " + title;
} }
else else
{ {