Merge branch 'v3' into redirect
This commit is contained in:
commit
5f3eae0f0c
@ -30,6 +30,7 @@ Unread =
|
|||||||
for ID, post of Unread.thread.posts
|
for ID, post of Unread.thread.posts
|
||||||
posts.push post if post.isReply
|
posts.push post if post.isReply
|
||||||
Unread.addPosts posts
|
Unread.addPosts posts
|
||||||
|
return unless Conf['Scroll to Last Read Post']
|
||||||
Unread.scroll()
|
Unread.scroll()
|
||||||
|
|
||||||
scroll: ->
|
scroll: ->
|
||||||
@ -43,11 +44,15 @@ Unread =
|
|||||||
break if prevID is post.ID
|
break if prevID is post.ID
|
||||||
prevID = post.ID
|
prevID = post.ID
|
||||||
break unless post.isHidden
|
break unless post.isHidden
|
||||||
root.scrollIntoView false
|
onload = -> root.scrollIntoView false
|
||||||
return
|
else
|
||||||
# Scroll to the last read post.
|
# Scroll to the last read post.
|
||||||
posts = Object.keys Unread.thread.posts
|
posts = Object.keys Unread.thread.posts
|
||||||
Header.scrollToPost Unread.thread.posts[posts[posts.length - 1]].nodes.root
|
post = Unread.thread.posts[posts[posts.length - 1]]
|
||||||
|
onload = -> Header.scrollToPost post.nodes.root
|
||||||
|
# Prevent the browser to scroll back to
|
||||||
|
# the previous scroll location on page load.
|
||||||
|
$.on window, 'load', onload
|
||||||
|
|
||||||
sync: ->
|
sync: ->
|
||||||
lastReadPost = Unread.db.get
|
lastReadPost = Unread.db.get
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user