From a14a1d3676c9ca2f40cf23f73011ef957a8d6598 Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Wed, 19 Oct 2011 09:33:31 +0000 Subject: [PATCH] Fixing chat to correctly count messages for deletion. --- gemp-lotr/gemp-lotr-web/src/main/webapp/js/chat.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/chat.js b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/chat.js index fc2716553..e5f9dd2ac 100644 --- a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/chat.js +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/chat.js @@ -66,9 +66,9 @@ var ChatBoxUI = Class.extend({ appendMessage: function(message, msgClass) { if (msgClass == undefined) msgClass = "chatMessage"; - this.chatMessagesDiv.append("
" + message + "
"); - if ($("div", this.chatMessagesDiv).length > 100) { - $("div", this.chatMessagesDiv).first().remove(); + this.chatMessagesDiv.append("
" + message + "
"); + if ($("div.message", this.chatMessagesDiv).length > 150) { + $("div.message", this.chatMessagesDiv).first().remove(); } this.chatMessagesDiv.prop({ scrollTop: this.chatMessagesDiv.prop("scrollHeight") }); },