From: Andrew Dolgov Date: Wed, 20 Mar 2013 09:23:24 +0000 (+0400) Subject: tweak moveToPost behaviour in unexpanded mode X-Git-Tag: 1.7.5~77 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=79074013cb86f097b73d840b759d26f548f14cfd;p=tt-rss.git tweak moveToPost behaviour in unexpanded mode --- diff --git a/js/viewfeed.js b/js/viewfeed.js index 4bb26187..4c6d9036 100644 --- a/js/viewfeed.js +++ b/js/viewfeed.js @@ -559,16 +559,23 @@ function moveToPost(mode, noscroll) { var prev_article = $("RROW-" + prev_id); var ctr = $("headlines-frame"); - if (!noscroll && article && article.offsetTop < ctr.scrollTop) { - scrollArticle(-ctr.offsetHeight/3); - } else if (!noscroll && prev_article && - prev_article.offsetTop < ctr.scrollTop) { + if (!getInitParam("cdm_expanded")) { cdmExpandArticle(prev_id); - scrollArticle(-ctr.offsetHeight/3); - } else if (prev_id) { - cdmExpandArticle(prev_id); - cdmScrollToArticleId(prev_id, noscroll); + cdmScrollToArticleId(prev_id, true); + } else { + + if (!noscroll && article && article.offsetTop < ctr.scrollTop) { + scrollArticle(-ctr.offsetHeight/3); + } else if (!noscroll && prev_article && + prev_article.offsetTop < ctr.scrollTop) { + cdmExpandArticle(prev_id); + scrollArticle(-ctr.offsetHeight/3); + } else if (prev_id) { + cdmExpandArticle(prev_id); + cdmScrollToArticleId(prev_id, noscroll); + } } + } else if (prev_id) { correctHeadlinesOffset(prev_id); view(prev_id, getActiveFeedId()); @@ -1365,7 +1372,10 @@ function cdmExpandArticle(id) { } setActiveArticleId(id); - cdmScrollToArticleId(id, true); + + if (!getInitParam("cdm_expanded")) { + cdmScrollToArticleId(id, true); + } elem = $("CICD-" + id);