Use interval to clear inactive channel buffers

This commit is contained in:
Mattias Erming 2014-12-12 00:01:19 +01:00
parent 07a509a862
commit a1f864b511

View File

@ -735,9 +735,18 @@ $(function() {
} }
}); });
setInterval(function() {
chat.find(".chan:not(.active)").each(function() {
var chan = $(this);
if (chan.find(".messages").children().slice(0, -100).remove().length) {
chan.find(".show-more").addClass("show");
}
});
}, 1000 * 10);
function clear() { function clear() {
chat.find(".active .messages").empty(); chat.find(".active .messages").empty();
chat.find(".active .show-more").removeClass("hidden"); chat.find(".active .show-more").addClass("show");
} }
function complete(word) { function complete(word) {