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

@ -107,6 +107,9 @@ var chat = (function()
//should we increment the counter?? //should we increment the counter??
if(increment) if(increment)
{
// Only increment if the chat window is not already open
if(!$('#chattext').is(':visible'))
{ {
var count = Number($("#chatcounter").text()); var count = Number($("#chatcounter").text());
count++; count++;
@ -122,6 +125,7 @@ var chat = (function()
chatMentions++; chatMentions++;
document.title = "("+chatMentions+") " + title; document.title = "("+chatMentions+") " + title;
} }
}
else else
{ {
$('#chatthrob').html("<b>"+authorName+"</b>" + ": " + text); $('#chatthrob').html("<b>"+authorName+"</b>" + ": " + text);