Infinite scroll fixes.

This commit is contained in:
softsimon 2020-03-01 16:33:18 +07:00
parent 90c05ccb51
commit dc775b7ee5
3 changed files with 5 additions and 2 deletions

View File

@ -1,4 +1,4 @@
<table class="table table-borderless" [fromRoot]="true" [infiniteScrollContainer]="'body'" infiniteScroll [infiniteScrollDistance]="1.5" [infiniteScrollUpDistance]="1.5" [infiniteScrollThrottle]="50" (scrolled)="loadMore()"> <table class="table table-borderless" [alwaysCallback]="true" [fromRoot]="true" [infiniteScrollContainer]="'body'" infiniteScroll [infiniteScrollDistance]="1.5" [infiniteScrollUpDistance]="1.5" [infiniteScrollThrottle]="50" (scrolled)="loadMore()">
<thead> <thead>
<th style="width: 210px;">Height</th> <th style="width: 210px;">Height</th>
<th class="d-none d-md-block" style="width: 210px;">Timestamp</th> <th class="d-none d-md-block" style="width: 210px;">Timestamp</th>

View File

@ -62,6 +62,9 @@ export class LatestBlocksComponent implements OnInit, OnDestroy {
} }
loadMore() { loadMore() {
if (this.isLoading) {
return;
}
this.isLoading = true; this.isLoading = true;
this.electrsApiService.listBlocks$(this.blocks[this.blocks.length - 1].height - 1) this.electrsApiService.listBlocks$(this.blocks[this.blocks.length - 1].height - 1)
.subscribe((blocks) => { .subscribe((blocks) => {

View File

@ -8,7 +8,7 @@
</ng-template> </ng-template>
</div> </div>
</div> </div>
<div class="header-bg box" infiniteScroll [fromRoot]="true" [infiniteScrollContainer]="'body'" [infiniteScrollDistance]="2" [infiniteScrollUpDistance]="1.5" [infiniteScrollThrottle]="50" (scrolled)="onScroll()"> <div class="header-bg box" infiniteScroll [alwaysCallback]="true" [fromRoot]="true" [infiniteScrollContainer]="'body'" [infiniteScrollDistance]="2" [infiniteScrollUpDistance]="1.5" [infiniteScrollThrottle]="50" (scrolled)="onScroll()">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<table class="table table-borderless smaller-text table-xs" style="margin: 0;"> <table class="table table-borderless smaller-text table-xs" style="margin: 0;">