fix infiniate scroller stuff
This commit is contained in:
parent
c2ccc22ade
commit
7e82d783c7
1 changed files with 8 additions and 1 deletions
|
@ -21,6 +21,12 @@ offset: number
|
||||||
changePromise: Promise<boolean> | undefined;
|
changePromise: Promise<boolean> | undefined;
|
||||||
scollDiv!: { scrollTop: number; scrollHeight: number; clientHeight: number };
|
scollDiv!: { scrollTop: number; scrollHeight: number; clientHeight: number };
|
||||||
|
|
||||||
|
resetVars(){
|
||||||
|
this.scrollTop=0;
|
||||||
|
this.scrollBottom=0;
|
||||||
|
this.averageheight=60;
|
||||||
|
this.watchtime=false;
|
||||||
|
}
|
||||||
constructor(
|
constructor(
|
||||||
getIDFromOffset: InfiniteScroller["getIDFromOffset"],
|
getIDFromOffset: InfiniteScroller["getIDFromOffset"],
|
||||||
getHTMLFromID: InfiniteScroller["getHTMLFromID"],
|
getHTMLFromID: InfiniteScroller["getHTMLFromID"],
|
||||||
|
@ -268,9 +274,9 @@ offset: number
|
||||||
|
|
||||||
return await this.changePromise;
|
return await this.changePromise;
|
||||||
}
|
}
|
||||||
|
|
||||||
async focus(id: string, flash = true): Promise<void>{
|
async focus(id: string, flash = true): Promise<void>{
|
||||||
let element: HTMLElement | undefined;
|
let element: HTMLElement | undefined;
|
||||||
|
this.resetVars();
|
||||||
for(const thing of this.HTMLElements){
|
for(const thing of this.HTMLElements){
|
||||||
if(thing[1] === id){
|
if(thing[1] === id){
|
||||||
element = thing[0];
|
element = thing[0];
|
||||||
|
@ -313,6 +319,7 @@ offset: number
|
||||||
this.div.remove();
|
this.div.remove();
|
||||||
this.div = null;
|
this.div = null;
|
||||||
}
|
}
|
||||||
|
this.resetVars();
|
||||||
try{
|
try{
|
||||||
for(const thing of this.HTMLElements){
|
for(const thing of this.HTMLElements){
|
||||||
await this.destroyFromID(thing[1]);
|
await this.destroyFromID(thing[1]);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue