From 5e135313a38fba2aa310e0a899273d121cf370b3 Mon Sep 17 00:00:00 2001 From: Rodolphe Breard Date: Thu, 24 Jan 2013 17:30:24 +0100 Subject: [PATCH] Tab.prototype.flushText bugfix --- lib/tab.nsui.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/tab.nsui.js b/lib/tab.nsui.js index 889a3a2..03f62a2 100644 --- a/lib/tab.nsui.js +++ b/lib/tab.nsui.js @@ -135,10 +135,8 @@ Tab.prototype.setActive = function() { } Tab.prototype.flushText = function() { - var str = this.chat_log.innerHTML, sep = "
", t = str.split(sep); - - if (t.length > this.buff_len + 1) { - this.chat_log.innerHTML = str.substring(str.indexOf(sep) + sep.length); + while (this.chat_log.children.length > this.buff_len) { + this.chat_log.removeChild(this.chat_log.children[0]); } while (this.history.length > this.buff_len) { this.history.shift();