diff --git a/lib/tab.nsui.js b/lib/tab.nsui.js index 1576274..3f6b47d 100644 --- a/lib/tab.nsui.js +++ b/lib/tab.nsui.js @@ -125,8 +125,16 @@ Tab.prototype.setActive = function() { this.el_lst.classList.add("tab-active"); } +Tab.prototype.flushText = function() { + var str = this.chat_log.innerHTML, sep = "
", t = str.split(sep); + + if (t.length > 1000) { + this.chat_log.innerHTML = str.substring(str.indexOf(sep) + sep.length); + } +}; + Tab.prototype.appendText = function(text) { - // TODO: flush text + this.flushText(); this.chat_log.innerHTML += text; this.chat_log.scrollTop = 42000; };