From a1f864b511b250b771f35e2aa1709d8d21338c6b Mon Sep 17 00:00:00 2001 From: Mattias Erming Date: Fri, 12 Dec 2014 00:01:19 +0100 Subject: [PATCH] Use interval to clear inactive channel buffers --- client/js/shout.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/client/js/shout.js b/client/js/shout.js index 0b78dd2..5b02e23 100644 --- a/client/js/shout.js +++ b/client/js/shout.js @@ -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() { chat.find(".active .messages").empty(); - chat.find(".active .show-more").removeClass("hidden"); + chat.find(".active .show-more").addClass("show"); } function complete(word) {