From: Darren Date: Mon, 5 Nov 2012 19:49:31 +0000 (+0000) Subject: Client: Scrollback setting implemented X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=f0999cef42a27beb1c2400f50462d3698253d897;p=KiwiIRC.git Client: Scrollback setting implemented --- diff --git a/client/assets/dev/model_panel.js b/client/assets/dev/model_panel.js index 41a4641..dc1ba64 100644 --- a/client/assets/dev/model_panel.js +++ b/client/assets/dev/model_panel.js @@ -9,7 +9,8 @@ _kiwi.model.Panel = Backbone.Model.extend({ }, addMsg: function (nick, msg, type, opts) { - var message_obj, bs, d; + var message_obj, bs, d, + scrollback = (parseInt(_kiwi.global.settings.get('scrollback'), 10) || 250); opts = opts || {}; @@ -46,8 +47,8 @@ _kiwi.model.Panel = Backbone.Model.extend({ bs.push(message_obj); // Keep the scrolback limited - if (bs.length > 250) { - bs.splice(250); + if (bs.length > scrollback) { + bs.splice(scrollback); } this.set({"scrollback": bs}, {silent: true}); diff --git a/client/assets/dev/view.js b/client/assets/dev/view.js index a5841a2..147e094 100644 --- a/client/assets/dev/view.js +++ b/client/assets/dev/view.js @@ -343,7 +343,7 @@ _kiwi.view.Panel = Backbone.View.extend({ // Make sure our DOM isn't getting too large (Acts as scrollback) this.msg_count++; - if (this.msg_count > 250) { + if (this.msg_count > (parseInt(_kiwi.global.settings.get('scrollback'), 10) || 250)) { $('.msg:first', this.$el).remove(); this.msg_count--; }