1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-24 10:41:28 +00:00

scroll handler: fix loadMoreHeadlines() not being called

This commit is contained in:
Andrew Dolgov
2018-12-01 10:19:45 +03:00
parent 8d190d539b
commit b87b4287b7
2 changed files with 33 additions and 37 deletions

View File

@@ -1117,32 +1117,38 @@ function unpackVisibleHeadlines() {
}
}
function headlinesScrollHandler(e) {
function headlinesScrollHandler(event) {
try {
unpackVisibleHeadlines();
// set topmost child in the buffer as active
if (isCombinedMode() && getInitParam("cdm_expanded") && getInitParam("cdm_auto_catchup") == 1) {
const rows = $$("#headlines-frame > div[id*=RROW]");
if (isCombinedMode()) {
updateFloatingTitle();
for (let i = 0; i < rows.length; i++) {
const row = rows[i];
// set topmost child in the buffer as active
if (getInitParam("cdm_expanded") && getInitParam("cdm_auto_catchup") == 1) {
if ($("headlines-frame").scrollTop <= row.offsetTop &&
row.offsetTop - $("headlines-frame").scrollTop < 100 &&
row.getAttribute("data-article-id") != getActiveArticleId()) {
const rows = $$("#headlines-frame > div[id*=RROW]");
setActiveArticleId(row.getAttribute("data-article-id"));
break;
for (let i = 0; i < rows.length; i++) {
const row = rows[i];
if ($("headlines-frame").scrollTop <= row.offsetTop &&
row.offsetTop - $("headlines-frame").scrollTop < 100 &&
row.getAttribute("data-article-id") != getActiveArticleId()) {
setActiveArticleId(row.getAttribute("data-article-id"));
break;
}
}
}
}
if (!_infscroll_disable) {
const hsp = $("headlines-spacer");
const container = $("headlines-frame");
if (hsp && hsp.offsetTop - 250 <= e.scrollTop + e.offsetHeight) {
if (hsp && hsp.offsetTop - 250 <= container.scrollTop + container.offsetHeight) {
hsp.innerHTML = "<span class='loading'><img src='images/indicator_tiny.gif'> " +
__("Loading, please wait...") + "</span>";
@@ -1153,10 +1159,6 @@ function headlinesScrollHandler(e) {
}
}
if (isCombinedMode()) {
updateFloatingTitle();
}
if (getInitParam("cdm_auto_catchup") == 1) {
let rows = $$("#headlines-frame > div[id*=RROW][class*=Unread]");