]> git.wh0rd.org Git - tt-rss.git/commitdiff
moveToPost: tweak unexpanded 'prev' behavior
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 21 Mar 2013 05:38:25 +0000 (09:38 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 21 Mar 2013 05:38:25 +0000 (09:38 +0400)
js/viewfeed.js

index e09a3a5ee1a88a0709ce5e39d5c74455dbe348ea..eee8df772ae54244ad907f6063162584bf77f132 100644 (file)
@@ -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) {