Never unread-scroll to OPs.
Also fix a dumb loop assignment.
This commit is contained in:
parent
009bb9f74d
commit
fa50087323
@ -38,11 +38,11 @@ Unread =
|
|||||||
return if (hash = location.hash.match /\d+/) and hash[0] of Unread.thread.posts
|
return if (hash = location.hash.match /\d+/) and hash[0] of Unread.thread.posts
|
||||||
if Unread.posts.length
|
if Unread.posts.length
|
||||||
# Scroll to before the first unread post.
|
# Scroll to before the first unread post.
|
||||||
prevID = 0
|
{root} = Unread.posts[0].nodes
|
||||||
while root = $.x 'preceding-sibling::div[contains(@class,"postContainer")][1]', Unread.posts[0].nodes.root
|
while root = $.x 'preceding-sibling::div[contains(@class,"postContainer")][1]', root
|
||||||
post = Get.postFromRoot root
|
post = Get.postFromRoot root
|
||||||
break if prevID is post.ID
|
# Don't scroll if we have 0 posts read in this thread.
|
||||||
prevID = post.ID
|
return unless post.isReply
|
||||||
break unless post.isHidden
|
break unless post.isHidden
|
||||||
onload = -> root.scrollIntoView false if checkPosition root
|
onload = -> root.scrollIntoView false if checkPosition root
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user