From: Andrew Dolgov Date: Thu, 21 Mar 2013 05:38:25 +0000 (+0400) Subject: moveToPost: tweak unexpanded 'prev' behavior X-Git-Tag: 1.7.5~58 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=24c215e2bb7ffeebbfb974c8cc20ebbe959e7bdb;p=tt-rss.git moveToPost: tweak unexpanded 'prev' behavior --- diff --git a/js/viewfeed.js b/js/viewfeed.js index e09a3a5e..eee8df77 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) {