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();