mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-20 13:41:30 +00:00
digest: do not show catchup/loadmore prompt when there's nothing to load
This commit is contained in:
45
digest.js
45
digest.js
@@ -47,9 +47,8 @@ function catchup_feed(feed_id, callback) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function catchup_visible_articles(callback) {
|
function get_visible_article_ids() {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
var elems = $("headlines-content").getElementsByTagName("LI");
|
var elems = $("headlines-content").getElementsByTagName("LI");
|
||||||
var ids = [];
|
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))) {
|
if (confirm(__("Mark %d displayed articles as read?").replace("%d", ids.length))) {
|
||||||
|
|
||||||
var query = "?op=rpc&subop=catchupSelected" +
|
var query = "?op=rpc&subop=catchupSelected" +
|
||||||
@@ -565,19 +576,25 @@ function parse_headlines(transport, replace, no_effects) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pr) {
|
var ids = get_visible_article_ids();
|
||||||
$('headlines-content').appendChild(pr);
|
|
||||||
if (!no_effects) new Effect.ScrollTo(inserted);
|
if (ids.length > 0) {
|
||||||
} else {
|
if (pr) {
|
||||||
$('headlines-content').innerHTML += "<li id='H-MORE-PROMPT'>" +
|
$('headlines-content').appendChild(pr);
|
||||||
"<div class='body'>" +
|
if (!no_effects) new Effect.ScrollTo(inserted);
|
||||||
"<a href=\"javascript:catchup_visible_articles()\">" +
|
} else {
|
||||||
__("Mark as read") + "</a> | " +
|
$('headlines-content').innerHTML += "<li id='H-MORE-PROMPT'>" +
|
||||||
"<a href=\"javascript:load_more()\">" +
|
"<div class='body'>" +
|
||||||
__("Load more...") + "</a>" +
|
"<a href=\"javascript:catchup_visible_articles()\">" +
|
||||||
"<img style=\"display : none\" "+
|
__("Mark as read") + "</a> | " +
|
||||||
|
"<a href=\"javascript:load_more()\">" +
|
||||||
|
__("Load more...") + "</a>" +
|
||||||
|
"<img style=\"display : none\" "+
|
||||||
"id=\"H-LOADING-IMG\" src='images/indicator_tiny.gif'>" +
|
"id=\"H-LOADING-IMG\" src='images/indicator_tiny.gif'>" +
|
||||||
"</div></li>";
|
"</div></li>";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// FIXME : display some kind of "nothing to see here" prompt here
|
||||||
}
|
}
|
||||||
|
|
||||||
if (replace && !no_effects)
|
if (replace && !no_effects)
|
||||||
|
|||||||
Reference in New Issue
Block a user