Fix Unread notifiers.
This commit is contained in:
parent
ce1086ac60
commit
f2631c9de1
@ -3478,20 +3478,21 @@
|
|||||||
replies: [],
|
replies: [],
|
||||||
foresee: [],
|
foresee: [],
|
||||||
node: function(post) {
|
node: function(post) {
|
||||||
var count, index;
|
var count, el, index;
|
||||||
if ((index = Unread.foresee.indexOf(post.id)) !== -1) {
|
if ((index = Unread.foresee.indexOf(post.id)) !== -1) {
|
||||||
Unread.foresee.splice(index, 1);
|
Unread.foresee.splice(index, 1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (post.root.hidden || post["class"]) {
|
el = post.el;
|
||||||
|
if (el.hidden) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
count = Unread.replies.push(post.el);
|
count = Unread.replies.push(el);
|
||||||
return Unread.update(count === 1);
|
return Unread.update(count === 1);
|
||||||
},
|
},
|
||||||
scroll: function() {
|
scroll: function() {
|
||||||
var bottom, height, i, reply, _i, _len, _ref;
|
var bottom, height, i, reply, _i, _len, _ref;
|
||||||
height = d.body.clientHeight;
|
height = d.documentElement.clientHeight;
|
||||||
_ref = Unread.replies;
|
_ref = Unread.replies;
|
||||||
for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
|
for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
|
||||||
reply = _ref[i];
|
reply = _ref[i];
|
||||||
|
|||||||
@ -2691,12 +2691,14 @@ Unread =
|
|||||||
if (index = Unread.foresee.indexOf post.id) isnt -1
|
if (index = Unread.foresee.indexOf post.id) isnt -1
|
||||||
Unread.foresee.splice index, 1
|
Unread.foresee.splice index, 1
|
||||||
return
|
return
|
||||||
return if post.root.hidden or post.class
|
{el} = post
|
||||||
count = Unread.replies.push post.el
|
# new HTML ???
|
||||||
|
return if el.hidden # or inlined/OP
|
||||||
|
count = Unread.replies.push el
|
||||||
Unread.update count is 1
|
Unread.update count is 1
|
||||||
|
|
||||||
scroll: ->
|
scroll: ->
|
||||||
height = d.body.clientHeight
|
height = d.documentElement.clientHeight
|
||||||
for reply, i in Unread.replies
|
for reply, i in Unread.replies
|
||||||
{bottom} = reply.getBoundingClientRect()
|
{bottom} = reply.getBoundingClientRect()
|
||||||
if bottom > height #post is not completely read
|
if bottom > height #post is not completely read
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user