Make QuoteYou scrolling use post ID instead of postContainer's.

Also make hiding detection more general.
This commit is contained in:
ccd0 2015-12-13 12:19:30 -08:00
parent db46cf64b2
commit 5e31c289b7

View File

@ -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