From 2ce949454f5305be2bf3b1a66385b1c16cbb791f Mon Sep 17 00:00:00 2001 From: MahdiTurki Date: Mon, 27 Apr 2020 20:14:40 +0100 Subject: Add hide list --- .../about-follows/about-follows.component.html | 22 +++++++++++++++++----- .../about-follows/about-follows.component.ts | 10 ++++++++-- 2 files changed, 25 insertions(+), 7 deletions(-) (limited to 'client/src') 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 50e00b651..a05c40184 100644 --- a/client/src/app/+about/about-follows/about-follows.component.html +++ b/client/src/app/+about/about-follows/about-follows.component.html @@ -6,10 +6,16 @@
This instance does not have instances followers.
- {{ follower }} + {{follower}} - - Show full list + + + {{ follower }} + + + + Show full list + Show less
@@ -28,8 +34,14 @@ {{ following }} - - Show full list + + + {{ following }} + + + + Show full list + Show less
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 e5526248c..00bd48c9c 100644 --- a/client/src/app/+about/about-follows/about-follows.component.ts +++ b/client/src/app/+about/about-follows/about-follows.component.ts @@ -13,6 +13,8 @@ import { InstanceFollowService } from '@app/shared/shared-instance' export class AboutFollowsComponent implements OnInit { followers: string[] = [] followings: string[] = [] + moreFollowers: string[] = [] + moreFollowings: string[] = [] showMoreFollowers = false showMoreFollowings = false @@ -75,7 +77,9 @@ export class AboutFollowsComponent implements OnInit { .subscribe( resultList => { const newFollowers = resultList.data.map(r => r.follower.host) - this.followers = this.followers.concat(newFollowers) + if (this.followers.length === 0) this.followers = this.followers.concat(newFollowers) + + else this.moreFollowers = this.moreFollowers.concat(newFollowers) this.followersPagination.totalItems = resultList.total @@ -93,7 +97,9 @@ export class AboutFollowsComponent implements OnInit { .subscribe( resultList => { const newFollowings = resultList.data.map(r => r.following.host) - this.followings = this.followings.concat(newFollowings) + if (this.followings.length===0) this.followings = this.followings.concat(newFollowings) + + else this.moreFollowings = this.moreFollowings.concat(newFollowings) this.followingsPagination.totalItems = resultList.total -- cgit v1.2.3