scroll handler: also invoke lazy load if last article in buffer is currently active

This commit is contained in:
Andrew Dolgov 2019-07-30 16:13:47 +03:00
parent c35a618b00
commit d172abb037
1 changed files with 2 additions and 2 deletions

View File

@ -279,8 +279,8 @@ define(["dojo/_base/declare"], function (declare) {
if (hsp && hsp.previousSibling) {
const last_row = hsp.previousSibling;
// invoke lazy load if last article in buffer is nearly visible
if (last_row.offsetTop - 250 <= container.scrollTop + container.offsetHeight) {
// invoke lazy load if last article in buffer is nearly visible OR is active
if (Article.getActive() == last_row.getAttribute("data-article-id") || last_row.offsetTop - 250 <= container.scrollTop + container.offsetHeight) {
hsp.innerHTML = "<span class='loading'><img src='images/indicator_tiny.gif'> " +
__("Loading, please wait...") + "</span>";