From fa500873237657886514e50f5f8053fbedbfa82f Mon Sep 17 00:00:00 2001 From: Mayhem Date: Fri, 5 Jul 2013 23:18:04 +0200 Subject: [PATCH] Never unread-scroll to OPs. Also fix a dumb loop assignment. --- src/Monitoring/Unread.coffee | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Monitoring/Unread.coffee b/src/Monitoring/Unread.coffee index b381a4441..6ad07f03e 100644 --- a/src/Monitoring/Unread.coffee +++ b/src/Monitoring/Unread.coffee @@ -38,11 +38,11 @@ Unread = return if (hash = location.hash.match /\d+/) and hash[0] of Unread.thread.posts if Unread.posts.length # Scroll to before the first unread post. - prevID = 0 - while root = $.x 'preceding-sibling::div[contains(@class,"postContainer")][1]', Unread.posts[0].nodes.root + {root} = Unread.posts[0].nodes + while root = $.x 'preceding-sibling::div[contains(@class,"postContainer")][1]', root post = Get.postFromRoot root - break if prevID is post.ID - prevID = post.ID + # Don't scroll if we have 0 posts read in this thread. + return unless post.isReply break unless post.isHidden onload = -> root.scrollIntoView false if checkPosition root else