From 5f3167dc5bd0e961b22dd8991962700096204574 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Tue, 11 Oct 2011 01:27:07 +0200 Subject: [PATCH] Unread count real performance improvement. Just like unread.scroll(e), don't update on every nodes. --- 4chan_x.user.js | 4 +++- script.coffee | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index e2477bcc2..51c9264be 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2656,7 +2656,9 @@ } unread.replies.push(root); unread.updateTitle(); - return Favicon.update(); + if (unread.replies.length === 1) { + return Favicon.update(); + } }, scroll: function(e) { var bottom, height, i, reply, _len, _ref; diff --git a/script.coffee b/script.coffee index cb894658b..8595c8a2a 100644 --- a/script.coffee +++ b/script.coffee @@ -1962,7 +1962,8 @@ unread = return if root.hidden or root.className unread.replies.push root unread.updateTitle() - Favicon.update() + if unread.replies.length is 1 + Favicon.update() scroll: (e) -> updater.focus = true