From 41755d1b8e412447965a475773bbd05a45926e57 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 22 Nov 2014 21:20:29 -0800 Subject: [PATCH] Fix Unread.scroll conflict with Fappe Tyme. --- src/Monitoring/Unread.coffee | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Monitoring/Unread.coffee b/src/Monitoring/Unread.coffee index bda79267a..2ccd761d9 100755 --- a/src/Monitoring/Unread.coffee +++ b/src/Monitoring/Unread.coffee @@ -45,13 +45,14 @@ Unread = return if (hash = location.hash.match /\d+/) and hash[0] of Unread.thread.posts # Scroll to the last non-hidden non-deleted read post. - post = null {posts} = Unread.thread - for ID in posts.keys - break if +ID > Unread.lastReadPost - post = posts[ID] unless posts[ID].isHidden - if post - Header.scrollToIfNeeded post.nodes.root, true + for ID in posts.keys by -1 + continue if +ID > Unread.lastReadPost + {root} = posts[ID].nodes + if root.getBoundingClientRect().height + Header.scrollToIfNeeded root, true + break + return sync: -> return unless Unread.lastReadPost?