]> git.wh0rd.org Git - tt-rss.git/commitdiff
getLoadedArticleIds: consider visible rows only
authorAndrew Dolgov <noreply@fakecake.org>
Tue, 22 Mar 2016 20:22:28 +0000 (23:22 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Tue, 22 Mar 2016 20:22:28 +0000 (23:22 +0300)
catchupFeedInGroup: hide articles when catching up, with caveats

classes/feeds.php
js/feedlist.js
js/viewfeed.js

index e0390ecc17cf212352f5bcb20d9540c50fe47297..65d55ab1b00816215045262cc8b90928a04f63f5 100755 (executable)
@@ -465,7 +465,7 @@ class Feeds extends Handler_Protected {
 
                                                        $vf_catchup_link = "<a class='catchup' onclick='catchupFeedInGroup($feed_id);' href='#'>".__('mark feed as read')."</a>";
 
-                                                       $reply['content'] .= "<div id='FTITLE-$feed_id' class='cdmFeedTitle'>".
+                                                       $reply['content'] .= "<div data-feed-id='$feed_id' id='FTITLE-$feed_id' class='cdmFeedTitle'>".
                                                                "<div style='float : right'>$feed_icon_img</div>".
                                                                "<a class='title' href=\"#\" onclick=\"viewfeed({feed:$feed_id})\">".
                                                                $line["feed_title"]."</a>
@@ -478,7 +478,7 @@ class Feeds extends Handler_Protected {
                                        $mouseover_attrs = "onmouseover='postMouseIn(event, $id)'
                                                onmouseout='postMouseOut($id)'";
 
-                                       $reply['content'] .= "<div class='hl $class' orig-feed-id='$feed_id' id='RROW-$id' $mouseover_attrs>";
+                                       $reply['content'] .= "<div class='hl $class' orig-feed-id='$feed_id' data-article-id='$id' id='RROW-$id' $mouseover_attrs>";
 
                                        $reply['content'] .= "<div class='hlLeft'>";
 
@@ -570,7 +570,7 @@ class Feeds extends Handler_Protected {
                                                                //$feed_icon_img = "<img class=\"tinyFeedIcon\" src=\"images/blank_icon.gif\" alt=\"\">";
                                                        }
 
-                                                       $reply['content'] .= "<div id='FTITLE-$feed_id' class='cdmFeedTitle'>".
+                                                       $reply['content'] .= "<div data-feed-id='$feed_id' id='FTITLE-$feed_id' class='cdmFeedTitle'>".
                                                                "<div style=\"float : right\">$feed_icon_img</div>".
                                                                "<a href=\"#\" class='title' onclick=\"viewfeed({feed:$feed_id})\">".
                                                                $line["feed_title"]."</a> $vf_catchup_link</div>";
@@ -584,7 +584,7 @@ class Feeds extends Handler_Protected {
                                        $expanded_class = $expand_cdm ? "expanded" : "expandable";
 
                                        $reply['content'] .= "<div class=\"cdm $hlc_suffix $expanded_class $class\"
-                                               id=\"RROW-$id\" orig-feed-id='$feed_id' $mouseover_attrs>";
+                                               id=\"RROW-$id\" data-article-id='$id' orig-feed-id='$feed_id' $mouseover_attrs>";
 
                                        $reply['content'] .= "<div class=\"cdmHeader\">";
                                        $reply['content'] .= "<div style=\"vertical-align : middle\">";
index a976c55bd44633a8716676e589c1a554d568d396..8e1aa645263ab72f47f5d50f26999e58effd804e 100644 (file)
@@ -453,8 +453,26 @@ function catchupFeedInGroup(id) {
 
                                rows.each(function (row) {
                                        row.removeClassName("Unread");
+
+                                       if (row.getAttribute("data-article-id") != getActiveArticleId()) {
+                                               new Effect.Fade(row, {duration: 0.5});
+                                       }
+
                                });
 
+                               var feedTitles = $$("#headlines-frame > div[class='cdmFeedTitle']");
+
+                               for (var i = 0; i < feedTitles.length; i++) {
+                                       if (feedTitles[i].getAttribute("data-feed-id") == id) {
+
+                                               if (i < feedTitles.length - 1) {
+                                                       new Effect.Fade(feedTitles[i], {duration: 0.5});
+                                               }
+
+                                               break;
+                                       }
+                               }
+
                                updateFloatingTitle(true);
                        }
 
index 2873a9e29d1158e2e1eb3a87345051c1b249af1e..8fccd5a49d0b6ea39286ff9e28c98036e0aac740 100755 (executable)
@@ -928,8 +928,10 @@ function getLoadedArticleIds() {
        var children = $$("#headlines-frame > div[id*=RROW-]");
 
        children.each(function(child) {
+               if (Element.visible(child)) {
                        rv.push(child.id.replace("RROW-", ""));
-               });
+               }
+       });
 
        return rv;