From 49c4dd7ec32e210537e98aca11a391c025224c0f Mon Sep 17 00:00:00 2001 From: MahdiTurki Date: Mon, 27 Apr 2020 11:18:24 +0100 Subject: Add button to display full list in About page --- .../about-follows/about-follows.component.ts | 29 +++++++++++----------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'client/src/app/+about/about-follows/about-follows.component.ts') diff --git a/client/src/app/+about/about-follows/about-follows.component.ts b/client/src/app/+about/about-follows/about-follows.component.ts index 17c6903b8..d88974b59 100644 --- a/client/src/app/+about/about-follows/about-follows.component.ts +++ b/client/src/app/+about/about-follows/about-follows.component.ts @@ -14,6 +14,9 @@ export class AboutFollowsComponent implements OnInit { followers: string[] = [] followings: string[] = [] + showMoreFollowers = false; + showMoreFollowings = false; + followersPagination: ComponentPagination = { currentPage: 1, itemsPerPage: 20, @@ -45,24 +48,20 @@ export class AboutFollowsComponent implements OnInit { this.loadMoreFollowings() } - onNearOfBottom () { - this.onNearOfFollowersBottom() + loadAllFollowings () { + while(hasMoreItems(this.followingsPagination)) { + this.followingsPagination.currentPage += 1 - this.onNearOfFollowingsBottom() + this.loadMoreFollowings() + } } - onNearOfFollowersBottom () { - if (!hasMoreItems(this.followersPagination)) return - - this.followersPagination.currentPage += 1 - this.loadMoreFollowers() - } - - onNearOfFollowingsBottom () { - if (!hasMoreItems(this.followingsPagination)) return - - this.followingsPagination.currentPage += 1 - this.loadMoreFollowings() + loadAllFollowers () { + while(hasMoreItems(this.followersPagination)) { + this.followersPagination.currentPage += 1 + + this.loadMoreFollowers(); + } } buildLink (host: string) { -- cgit v1.2.3