From 182e307e77c79fb87c16657f6236e86fc25795d4 Mon Sep 17 00:00:00 2001 From: Darren Date: Fri, 28 Oct 2011 09:52:29 +0100 Subject: [PATCH] Limited scrollback --- client/js/front.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/js/front.js b/client/js/front.js index a59aa90..1f9baa0 100644 --- a/client/js/front.js +++ b/client/js/front.js @@ -1315,6 +1315,7 @@ Tabview.prototype.tab = null; Tabview.prototype.topic = ""; Tabview.prototype.safe_to_close = false; // If we have been kicked/banned/etc from this channel, don't wait for a part message Tabview.prototype.panel = null; +Tabview.prototype.msg_count = 0; Tabview.prototype.show = function () { var w, u; @@ -1453,6 +1454,12 @@ Tabview.prototype.addMsg = function (time, nick, msg, type, style) { line_msg = $('
' + time + '
' + nick + '
' + msg + '
'); this.div.append(line_msg); + this.msg_count++; + if (this.msg_count > 250) { + $('.msg:first', this.div).remove(); + this.msg_count--; + } + if (!touchscreen) { this.scrollBottom(); } else { -- 2.25.1