summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorwolle <[email protected]>2014-06-28 14:09:25 +0200
committerwolfgangasdf <[email protected]>2014-06-28 15:04:08 +0200
commit86f32020f6a06af52eb226bf95c6515cb2537663 (patch)
treec3301a19ec1b659c417dd83cd0b593ddf85698ee /js
parentc7a0cb7cf42ebdeb19e2dbe971f569d2991b15fd (diff)
scroll to end to show next feed or category
only if cmd_auto_catchup and on_catchup_show_next_feed set
Diffstat (limited to 'js')
-rw-r--r--js/viewfeed.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/js/viewfeed.js b/js/viewfeed.js
index 9672c47ba..a786904e3 100644
--- a/js/viewfeed.js
+++ b/js/viewfeed.js
@@ -8,6 +8,7 @@ var post_under_pointer = false;
var last_requested_article = false;
var catchup_id_batch = [];
+var catchup_go_next = false;
var catchup_timeout_id = false;
var cids_requested = [];
@@ -1328,6 +1329,8 @@ function headlines_scroll_handler(e) {
var ts = new Date().getTime();
if (ts - _last_headlines_update < 100) return;
+ var atend = true;
+
$$("#headlines-frame > div[id*=RROW][class*=Unread]").each(
function(child) {
if (child.hasClassName("Unread") && $("headlines-frame").scrollTop >
@@ -1339,10 +1342,18 @@ function headlines_scroll_handler(e) {
catchup_id_batch.push(id);
//console.log("auto_catchup_batch: " + catchup_id_batch.toString());
+ } else {
+ atend = false;
}
});
+ if (atend) {
+ if (getInitParam("on_catchup_show_next_feed") == "1") {
+ catchup_go_next = true;
+ }
+ }
+
if (catchup_id_batch.length > 0) {
window.clearTimeout(catchup_timeout_id);
@@ -1388,6 +1399,12 @@ function catchupBatchedArticles() {
} });
}
+ if (catchup_go_next) {
+ catchup_go_next = false;
+ var is_cat = activeFeedIsCat();
+ var nuf = getNextUnreadFeed(getActiveFeedId(), is_cat);
+ if (nuf) viewfeed(nuf, '', is_cat);
+ }
} catch (e) {
exception_error("catchupBatchedArticles", e);