diff --git a/4chan_x.user.js b/4chan_x.user.js index 22eebf26c..1844119b8 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -3478,20 +3478,21 @@ replies: [], foresee: [], node: function(post) { - var count, index; + var count, el, index; if ((index = Unread.foresee.indexOf(post.id)) !== -1) { Unread.foresee.splice(index, 1); return; } - if (post.root.hidden || post["class"]) { + el = post.el; + if (el.hidden) { return; } - count = Unread.replies.push(post.el); + count = Unread.replies.push(el); return Unread.update(count === 1); }, scroll: function() { var bottom, height, i, reply, _i, _len, _ref; - height = d.body.clientHeight; + height = d.documentElement.clientHeight; _ref = Unread.replies; for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { reply = _ref[i]; diff --git a/script.coffee b/script.coffee index 9cb4c471e..74d6074c6 100644 --- a/script.coffee +++ b/script.coffee @@ -2691,12 +2691,14 @@ Unread = if (index = Unread.foresee.indexOf post.id) isnt -1 Unread.foresee.splice index, 1 return - return if post.root.hidden or post.class - count = Unread.replies.push post.el + {el} = post + # new HTML ??? + return if el.hidden # or inlined/OP + count = Unread.replies.push el Unread.update count is 1 scroll: -> - height = d.body.clientHeight + height = d.documentElement.clientHeight for reply, i in Unread.replies {bottom} = reply.getBoundingClientRect() if bottom > height #post is not completely read