Fixing spaces between messages. Now it works great!

This commit is contained in:
marcins78@gmail.com
2011-09-12 21:01:37 +00:00
parent a8f9dec190
commit f4de919cf5

View File

@@ -46,9 +46,9 @@ var ChatBoxUI = Class.extend({
},
appendMessage: function(message) {
this.chatMessagesDiv.append("<p>" + message + "</p>");
if ($("p", this.chatMessagesDiv).length > 50) {
$("p", this.chatMessagesDiv).first().remove();
this.chatMessagesDiv.append("<div class='chatMessage'>" + message + "</div>");
if ($("div", this.chatMessagesDiv).length > 50) {
$("div", this.chatMessagesDiv).first().remove();
}
this.chatMessagesDiv.prop({ scrollTop: this.chatMessagesDiv.prop("scrollHeight") });
},