Fix Unread.read

This commit is contained in:
Zixaphir 2013-08-08 16:32:59 -07:00
parent 73250fcc3d
commit bcc68168b0
3 changed files with 40 additions and 30 deletions

View File

@ -7968,20 +7968,24 @@
i = 0;
while (post = posts[i]) {
bottom = post.nodes.root.getBoundingClientRect().bottom;
if (bottom > height) {
i++;
continue;
}
ID = post.ID;
if (Conf['Quote Threading']) {
posts.splice(i, 1);
continue;
if (bottom < height) {
ID = post.ID;
if (Conf['Quote Threading']) {
posts.splice(i, 1);
continue;
}
} else {
posts.splice(0, i);
break;
if (!Conf['Quote Threading']) {
break;
}
}
i++;
}
if (!Conf['Quote Threading']) {
if (i) {
posts.splice(0, i);
}
}
if (!ID) {
return;
}

View File

@ -7949,20 +7949,24 @@
i = 0;
while (post = posts[i]) {
bottom = post.nodes.root.getBoundingClientRect().bottom;
if (bottom > height) {
i++;
continue;
}
ID = post.ID;
if (Conf['Quote Threading']) {
posts.splice(i, 1);
continue;
if (bottom < height) {
ID = post.ID;
if (Conf['Quote Threading']) {
posts.splice(i, 1);
continue;
}
} else {
posts.splice(0, i);
break;
if (!Conf['Quote Threading']) {
break;
}
}
i++;
}
if (!Conf['Quote Threading']) {
if (i) {
posts.splice(0, i);
}
}
if (!ID) {
return;
}

View File

@ -123,18 +123,20 @@ Unread =
while post = posts[i]
{bottom} = post.nodes.root.getBoundingClientRect()
if bottom > height # post isnt completely read
i++
continue
{ID} = post
if Conf['Quote Threading']
posts.splice i, 1
continue
if bottom < height # post is completely read
{ID} = post
if Conf['Quote Threading']
posts.splice i, 1
continue
else
posts.splice 0, i
break
unless Conf['Quote Threading']
break
i++
unless Conf['Quote Threading']
if i
posts.splice 0, i
return unless ID
Unread.lastReadPost = ID if Unread.lastReadPost < ID or !Unread.lastReadPost