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.html | 6 ++++- .../about-follows/about-follows.component.scss | 4 +++ .../about-follows/about-follows.component.ts | 29 +++++++++++----------- 3 files changed, 23 insertions(+), 16 deletions(-) (limited to 'client/src/app/+about') diff --git a/client/src/app/+about/about-follows/about-follows.component.html b/client/src/app/+about/about-follows/about-follows.component.html index 6d38e2109..fbca9f3b0 100644 --- a/client/src/app/+about/about-follows/about-follows.component.html +++ b/client/src/app/+about/about-follows/about-follows.component.html @@ -1,4 +1,4 @@ -
+

Follows

Followers instances

@@ -8,6 +8,8 @@ {{ follower }} + + Show full list
@@ -18,6 +20,8 @@ {{ following }} + + Show full list
diff --git a/client/src/app/+about/about-follows/about-follows.component.scss b/client/src/app/+about/about-follows/about-follows.component.scss index c6114d270..32a015e89 100644 --- a/client/src/app/+about/about-follows/about-follows.component.scss +++ b/client/src/app/+about/about-follows/about-follows.component.scss @@ -16,3 +16,7 @@ a { .no-results { justify-content: flex-start; } + +#showMore { + color: black; +} 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