]> git.wh0rd.org Git - tt-rss.git/commitdiff
tweak moveToPost behaviour in unexpanded mode
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 20 Mar 2013 09:23:24 +0000 (13:23 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 20 Mar 2013 09:23:24 +0000 (13:23 +0400)
js/viewfeed.js

index 4bb2618791cfcc316c385f73dbe27c542f14269a..4c6d903660cc2279d5c01214b4b007b685baad76 100644 (file)
@@ -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);