From 5e31c289b7ce6c2ab4364b879c864e6fbf59f9ca Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sun, 13 Dec 2015 12:19:30 -0800 Subject: [PATCH] Make QuoteYou scrolling use post ID instead of postContainer's. Also make hiding detection more general. --- src/Quotelinks/QuoteYou.coffee | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Quotelinks/QuoteYou.coffee b/src/Quotelinks/QuoteYou.coffee index 27284fc9c..fd14a2986 100644 --- a/src/Quotelinks/QuoteYou.coffee +++ b/src/Quotelinks/QuoteYou.coffee @@ -52,12 +52,13 @@ QuoteYou = posts = $$ '.quotesYou' QuoteYou.cb.scroll posts[if type is 'following' then 0 else posts.length - 1] - scroll: (post) -> - if Get.postFromRoot(post).isHidden + scroll: (root) -> + post = $ '.post', root + if !post.getBoundingClientRect().height return false else - QuoteYou.lastRead = post + QuoteYou.lastRead = root window.location = "##{post.id}" Header.scrollTo post - $.addClass $('.post', post), 'highlight' + $.addClass post, 'highlight' return true