slight corrections
This commit is contained in:
@@ -29,11 +29,11 @@ class InfiniteScroller {
|
|||||||
{
|
{
|
||||||
let oldheight = 0;
|
let oldheight = 0;
|
||||||
new ResizeObserver(_ => {
|
new ResizeObserver(_ => {
|
||||||
const change = oldheight - this.div.offsetHeight;
|
const change = oldheight - div.offsetHeight;
|
||||||
if (change > 0) {
|
if (change > 0 && this.scroll) {
|
||||||
this.scroll.scrollTop += change;
|
this.scroll.scrollTop += change;
|
||||||
}
|
}
|
||||||
oldheight = this.div.offsetHeight;
|
oldheight = div.offsetHeight;
|
||||||
this.watchForChange();
|
this.watchForChange();
|
||||||
}).observe(div);
|
}).observe(div);
|
||||||
}
|
}
|
||||||
|
@@ -30,11 +30,11 @@ class InfiniteScroller{
|
|||||||
{
|
{
|
||||||
let oldheight=0;
|
let oldheight=0;
|
||||||
new ResizeObserver(_=>{
|
new ResizeObserver(_=>{
|
||||||
const change=oldheight-this.div.offsetHeight;
|
const change=oldheight-div.offsetHeight;
|
||||||
if(change>0){
|
if(change>0&&this.scroll){
|
||||||
this.scroll.scrollTop+=change;
|
this.scroll.scrollTop+=change;
|
||||||
}
|
}
|
||||||
oldheight=this.div.offsetHeight;
|
oldheight=div.offsetHeight;
|
||||||
this.watchForChange();
|
this.watchForChange();
|
||||||
}).observe(div);
|
}).observe(div);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user