@ -272,17 +272,21 @@ define(["dojo/_base/declare"], function (declare) {
}
}
if ( ! Feeds . infscroll _disabled ) {
if ( ! Feeds . infscroll _disabled && ! Feeds . infscroll _in _progress ) {
const hsp = $ ( "headlines-spacer" ) ;
const container = $ ( "headlines-frame" ) ;
if ( hsp && hsp . offsetTop - 250 <= container . scrollTop + container . offsetHeight ) {
if ( hsp && hsp . previousSibling ) {
const last _row = hsp . previousSibling ;
hsp . innerHTML = "<span class='loading'><img src='images/indicator_tiny.gif'> " +
_ _ ( "Loading, please wait..." ) + "</span>" ;
// invoke lazy load if last article in buffer is nearly visible
if ( last _row . offsetTop - 250 <= container . scrollTop + container . offsetHeight ) {
hsp . innerHTML = "<span class='loading'><img src='images/indicator_tiny.gif'> " +
_ _ ( "Loading, please wait..." ) + "</span>" ;
Headlines . loadMore ( ) ;
return ;
Headlines . loadMore ( ) ;
return ;
}
}
}
@ -558,13 +562,14 @@ define(["dojo/_base/declare"], function (declare) {
const headlines _count = reply [ 'headlines-info' ] [ 'count' ] ;
Feeds . infscroll _disabled = parseInt ( headlines _count ) < 30 ;
console . log ( 'received' , headlines _count , 'headlines, infscroll disabled=' , Feeds . infscroll _disabled ) ;
//this.vgroup_last_feed = reply['headlines-info']['vgroup_last_feed'];
this . current _first _id = reply [ 'headlines' ] [ 'first_id' ] ;
console . log ( 'received' , headlines _count , 'headlines' ) ;
if ( ! append ) {
Feeds . infscroll _disabled = parseInt ( headlines _count ) != 30 ;
console . log ( 'infscroll_disabled=' , Feeds . infscroll _disabled ) ;
// TODO: the below needs to be applied again when switching expanded/expandable on the fly
// via hotkeys, not just on feed load
@ -663,7 +668,7 @@ define(["dojo/_base/declare"], function (declare) {
}
}
Feeds . infscroll _disabled = headlines _appended != 3 0;
Feeds . infscroll _disabled = headlines _appended == 0;
console . log ( 'appended' , headlines _appended , 'headlines, infscroll_disabled=' , Feeds . infscroll _disabled ) ;
@ -682,10 +687,10 @@ define(["dojo/_base/declare"], function (declare) {
}
} else {
console . log ( "no new headlines received" ) ;
Feeds . infscroll _disabled = true ;
const first _id _changed = reply [ 'headlines' ] [ 'first_id_changed' ] ;
console . log ( "first id changed:" + first _id _changed ) ;
console . log ( "no headlines received, infscroll_disabled=" , Feeds . infscroll _disabled , 'first_id_changed=' , first _id _changed ) ;
let hsp = $ ( "headlines-spacer" ) ;