From 9ff94840316c7e08ce8a61d188a42c4f1bc71d72 Mon Sep 17 00:00:00 2001 From: James Campos Date: Tue, 28 Dec 2010 11:11:44 -0800 Subject: [PATCH] work on updated posts --- 4chan_x.coffee | 6 ++++-- 4chan_x.js | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/4chan_x.coffee b/4chan_x.coffee index f33584d05..0be951ac7 100644 --- a/4chan_x.coffee +++ b/4chan_x.coffee @@ -1318,10 +1318,12 @@ else #not reply a.addEventListener('click', expandComment, true) if getConfig 'Unread Count' - g.replies = $$ 'td.reply, td.replyhl' + g.replies = [] document.title = '(0) ' + document.title - scroll() document.addEventListener 'scroll', scroll, true + g.callbacks.push (root) -> + g.replies.push $$ 'td.reply, td.replyhl', root + scroll() callback() for callback in g.callbacks d.body.addEventListener('DOMNodeInserted', nodeInserted, true) diff --git a/4chan_x.js b/4chan_x.js index 809dd90f2..69684c8b3 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1685,10 +1685,13 @@ } } if (getConfig('Unread Count')) { - g.replies = $$('td.reply, td.replyhl'); + g.replies = []; document.title = '(0) ' + document.title; - scroll(); document.addEventListener('scroll', scroll, true); + g.callbacks.push(function(root) { + g.replies.push($$('td.reply, td.replyhl', root)); + return scroll(); + }); } _ref4 = g.callbacks; for (_m = 0, _len6 = _ref4.length; _m < _len6; _m++) {