From 2d052e42b595b6396a140d82877e9440bc405f97 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 22 Mar 2016 23:22:28 +0300 Subject: [PATCH] getLoadedArticleIds: consider visible rows only catchupFeedInGroup: hide articles when catching up, with caveats --- classes/feeds.php | 8 ++++---- js/feedlist.js | 18 ++++++++++++++++++ js/viewfeed.js | 4 +++- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/classes/feeds.php b/classes/feeds.php index e0390ecc1..65d55ab1b 100755 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -465,7 +465,7 @@ class Feeds extends Handler_Protected { $vf_catchup_link = "".__('mark feed as read').""; - $reply['content'] .= "
". + $reply['content'] .= "
". "
$feed_icon_img
". "". $line["feed_title"]." @@ -478,7 +478,7 @@ class Feeds extends Handler_Protected { $mouseover_attrs = "onmouseover='postMouseIn(event, $id)' onmouseout='postMouseOut($id)'"; - $reply['content'] .= "
"; + $reply['content'] .= "
"; $reply['content'] .= "
"; @@ -570,7 +570,7 @@ class Feeds extends Handler_Protected { //$feed_icon_img = "\"\""; } - $reply['content'] .= "
". + $reply['content'] .= "
". "
$feed_icon_img
". "". $line["feed_title"]." $vf_catchup_link
"; @@ -584,7 +584,7 @@ class Feeds extends Handler_Protected { $expanded_class = $expand_cdm ? "expanded" : "expandable"; $reply['content'] .= "
"; + id=\"RROW-$id\" data-article-id='$id' orig-feed-id='$feed_id' $mouseover_attrs>"; $reply['content'] .= "
"; $reply['content'] .= "
"; diff --git a/js/feedlist.js b/js/feedlist.js index a976c55bd..8e1aa6452 100644 --- a/js/feedlist.js +++ b/js/feedlist.js @@ -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); } diff --git a/js/viewfeed.js b/js/viewfeed.js index 2873a9e29..8fccd5a49 100755 --- a/js/viewfeed.js +++ b/js/viewfeed.js @@ -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;