When there is a valid hash, scroll to corresponding post instead of the unread posts. #968
This commit is contained in:
parent
a46ba080fd
commit
09642b63da
@ -3633,7 +3633,9 @@ Unread =
|
||||
$.get "lastReadPosts.#{@board}", threads: {}, (item) =>
|
||||
Unread.lastReadPost = item["lastReadPosts.#{@board}"].threads[@] or 0
|
||||
Unread.addPosts posts
|
||||
if Unread.posts.length
|
||||
if (hash = location.hash.match /\d+/) and post = @posts[hash[0]]
|
||||
post.nodes.root.scrollIntoView()
|
||||
else if Unread.posts.length
|
||||
# Scroll to before the first unread post.
|
||||
$.x('preceding-sibling::div[contains(@class,"postContainer")][1]', Unread.posts[0].nodes.root).scrollIntoView false
|
||||
else if posts.length
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user