From b2bbbd232457a6e4b088fa2a3f694843472ed9cd Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 10 Sep 2012 21:00:35 +0400 Subject: [PATCH] tweak infscroll threshold --- js/viewfeed.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/js/viewfeed.js b/js/viewfeed.js index c38d9d55..9e43e29c 100644 --- a/js/viewfeed.js +++ b/js/viewfeed.js @@ -305,7 +305,9 @@ function article_callback2(transport, id) { request_counters(); - try { + headlines_scroll_handler($("headlines-frame")); + +/* try { if (!_infscroll_disable && $$("#headlines-frame > div[id*=RROW]").last().hasClassName("Selected")) { @@ -313,7 +315,7 @@ function article_callback2(transport, id) { } } catch (e) { console.warn(e); - } + } */ notify(""); } catch (e) { @@ -382,7 +384,7 @@ function view(id) { // the server roundtrip altogether if (cids_to_request.length == 0) { - try { +/* try { if (!_infscroll_disable && $$("#headlines-frame > div[id*=RROW]").last().hasClassName("Selected")) { @@ -390,7 +392,9 @@ function view(id) { } } catch (e) { console.warn(e); - } + } */ + + headlines_scroll_handler($("headlines-frame")); return; } @@ -1113,8 +1117,9 @@ function headlines_scroll_handler(e) { var hsp = $("headlines-spacer"); if (!_infscroll_disable) { - if (hsp && (e.scrollTop + e.offsetHeight > hsp.offsetTop) || - e.scrollTop + e.offsetHeight > e.scrollHeight - 100) { + if ((hsp && e.scrollTop + e.offsetHeight > hsp.offsetTop) || + (e.scrollHeight != 0 && + ((e.scrollTop + e.offsetHeight) / e.scrollHeight >= 0.7))) { if (hsp) hsp.innerHTML = " " + -- 2.39.5