1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-20 16:21:28 +00:00

digest: do not show catchup/loadmore prompt when there's nothing to load

This commit is contained in:
Andrew Dolgov
2010-09-22 14:17:26 +04:00
parent b8a1b2ae94
commit 58226f869c

View File

@@ -47,9 +47,8 @@ function catchup_feed(feed_id, callback) {
}
}
function catchup_visible_articles(callback) {
function get_visible_article_ids() {
try {
var elems = $("headlines-content").getElementsByTagName("LI");
var ids = [];
@@ -59,6 +58,18 @@ function catchup_visible_articles(callback) {
}
}
return ids;
} catch (e) {
exception_error("get_visible_article_ids", e);
}
}
function catchup_visible_articles(callback) {
try {
var ids = get_visible_article_ids();
if (confirm(__("Mark %d displayed articles as read?").replace("%d", ids.length))) {
var query = "?op=rpc&subop=catchupSelected" +
@@ -565,6 +576,9 @@ function parse_headlines(transport, replace, no_effects) {
}
}
var ids = get_visible_article_ids();
if (ids.length > 0) {
if (pr) {
$('headlines-content').appendChild(pr);
if (!no_effects) new Effect.ScrollTo(inserted);
@@ -579,6 +593,9 @@ function parse_headlines(transport, replace, no_effects) {
"id=\"H-LOADING-IMG\" src='images/indicator_tiny.gif'>" +
"</div></li>";
}
} else {
// FIXME : display some kind of "nothing to see here" prompt here
}
if (replace && !no_effects)
new Effect.Appear('headlines-content', {duration : 0.3});