load block/tx pages at correct blockchain scroll position

This commit is contained in:
Mononaut
2022-12-28 06:05:46 -06:00
parent 32bf30872d
commit bf941b0227
9 changed files with 40 additions and 11 deletions

View File

@@ -49,7 +49,7 @@
</ng-container>
</ng-template>
</div>
<div [hidden]="!arrowVisible" id="arrow-up" [style.transition]="transition" [ngStyle]="{'left': arrowLeftPx + 'px' }"></div>
<div [hidden]="!arrowVisible" id="arrow-up" [style.transition]="arrowTransition" [ngStyle]="{'left': arrowLeftPx + 'px' }"></div>
</div>
<ng-template #loadingBlocksTemplate>

View File

@@ -43,7 +43,7 @@ export class BlockchainBlocksComponent implements OnInit, OnChanges, OnDestroy {
arrowVisible = false;
arrowLeftPx = 30;
blocksFilled = false;
transition = '1s';
arrowTransition = '1s';
showMiningInfo = false;
timeLtrSubscription: Subscription;
timeLtr: boolean;
@@ -179,13 +179,13 @@ export class BlockchainBlocksComponent implements OnInit, OnChanges, OnDestroy {
const blockindex = this.blocks.findIndex((b) => b.height === this.markHeight);
if (blockindex > -1) {
if (!animate) {
this.transition = 'inherit';
this.arrowTransition = 'inherit';
}
this.arrowVisible = true;
if (newBlockFromLeft) {
this.arrowLeftPx = blockindex * 155 + 30 - 205;
setTimeout(() => {
this.transition = '2s';
this.arrowTransition = '2s';
this.arrowLeftPx = blockindex * 155 + 30;
this.cd.markForCheck();
}, 50);
@@ -193,9 +193,9 @@ export class BlockchainBlocksComponent implements OnInit, OnChanges, OnDestroy {
this.arrowLeftPx = blockindex * 155 + 30;
if (!animate) {
setTimeout(() => {
this.transition = '2s';
this.arrowTransition = '2s';
this.cd.markForCheck();
});
}, 50);
}
}
} else {