Fix Unread notifiers.

This commit is contained in:
Nicolas Stepien 2012-05-02 02:12:51 +02:00
parent ce1086ac60
commit f2631c9de1
2 changed files with 10 additions and 7 deletions

View File

@ -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];

View File

@ -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