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) { appendMessage: function(message) {
this.chatMessagesDiv.append("<p>" + message + "</p>"); this.chatMessagesDiv.append("<div class='chatMessage'>" + message + "</div>");
if ($("p", this.chatMessagesDiv).length > 50) { if ($("div", this.chatMessagesDiv).length > 50) {
$("p", this.chatMessagesDiv).first().remove(); $("div", this.chatMessagesDiv).first().remove();
} }
this.chatMessagesDiv.prop({ scrollTop: this.chatMessagesDiv.prop("scrollHeight") }); this.chatMessagesDiv.prop({ scrollTop: this.chatMessagesDiv.prop("scrollHeight") });
}, },