Merge branch 'v3' into redirect

This commit is contained in:
Mayhem 2013-05-06 19:04:00 +02:00
commit 5f3eae0f0c

View File

@ -30,6 +30,7 @@ Unread =
for ID, post of Unread.thread.posts
posts.push post if post.isReply
Unread.addPosts posts
return unless Conf['Scroll to Last Read Post']
Unread.scroll()
scroll: ->
@ -43,11 +44,15 @@ Unread =
break if prevID is post.ID
prevID = post.ID
break unless post.isHidden
root.scrollIntoView false
return
# Scroll to the last read post.
posts = Object.keys Unread.thread.posts
Header.scrollToPost Unread.thread.posts[posts[posts.length - 1]].nodes.root
onload = -> root.scrollIntoView false
else
# Scroll to the last read post.
posts = Object.keys Unread.thread.posts
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: ->
lastReadPost = Unread.db.get