mirror of
https://github.com/mempool/mempool.git
synced 2025-02-22 06:21:46 +01:00
Don't tweak scrollLeft if time is left to right
This commit is contained in:
parent
bb5b771128
commit
1779c672e3
1 changed files with 10 additions and 8 deletions
|
@ -194,14 +194,16 @@ export class StartComponent implements OnInit, AfterViewChecked, OnDestroy {
|
|||
applyScrollLeft(): void {
|
||||
if (this.blockchainContainer?.nativeElement?.scrollWidth) {
|
||||
let lastScrollLeft = null;
|
||||
while (this.scrollLeft < 0 && this.shiftPagesForward() && lastScrollLeft !== this.scrollLeft) {
|
||||
lastScrollLeft = this.scrollLeft;
|
||||
this.scrollLeft += this.pageWidth;
|
||||
}
|
||||
lastScrollLeft = null;
|
||||
while (this.scrollLeft > this.blockchainContainer.nativeElement.scrollWidth && this.shiftPagesBack() && lastScrollLeft !== this.scrollLeft) {
|
||||
lastScrollLeft = this.scrollLeft;
|
||||
this.scrollLeft -= this.pageWidth;
|
||||
if (!this.timeLtr) {
|
||||
while (this.scrollLeft < 0 && this.shiftPagesForward() && lastScrollLeft !== this.scrollLeft) {
|
||||
lastScrollLeft = this.scrollLeft;
|
||||
this.scrollLeft += this.pageWidth;
|
||||
}
|
||||
lastScrollLeft = null;
|
||||
while (this.scrollLeft > this.blockchainContainer.nativeElement.scrollWidth && this.shiftPagesBack() && lastScrollLeft !== this.scrollLeft) {
|
||||
lastScrollLeft = this.scrollLeft;
|
||||
this.scrollLeft -= this.pageWidth;
|
||||
}
|
||||
}
|
||||
this.blockchainContainer.nativeElement.scrollLeft = this.scrollLeft;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue