From 24c215e2bb7ffeebbfb974c8cc20ebbe959e7bdb Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 21 Mar 2013 09:38:25 +0400 Subject: [PATCH] moveToPost: tweak unexpanded 'prev' behavior --- js/viewfeed.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/js/viewfeed.js b/js/viewfeed.js index e09a3a5ee..eee8df772 100644 --- a/js/viewfeed.js +++ b/js/viewfeed.js @@ -560,8 +560,13 @@ function moveToPost(mode, noscroll) { var ctr = $("headlines-frame"); if (!getInitParam("cdm_expanded")) { - cdmExpandArticle(prev_id); - cdmScrollToArticleId(prev_id, true); + + if (!noscroll && article.offsetTop < ctr.scrollTop) { + scrollArticle(-ctr.offsetHeight/3); + } else { + cdmExpandArticle(prev_id); + cdmScrollToArticleId(prev_id, true); + } } else { if (!noscroll && article && article.offsetTop < ctr.scrollTop) {