diff --git a/resources/assets/js/components/Timeline.vue b/resources/assets/js/components/Timeline.vue index 0d60705be..baf0f6528 100644 --- a/resources/assets/js/components/Timeline.vue +++ b/resources/assets/js/components/Timeline.vue @@ -183,11 +183,11 @@

{{profile.statuses_count}}

Posts

- +

{{profile.followers_count}}

Followers

- +

{{profile.following_count}}

Following

@@ -297,6 +297,64 @@ + +
+
+
+ + + +
+

+ + {{user.username}} + +

+

+ {{user.display_name}} +

+
+
+
+
+

Load more

+
+
+
+ +
+
+
+ + + +
+

+ + {{user.username}} + +

+

+ {{user.display_name}} +

+
+
+
+
+

Load more

+
+
+
@@ -337,7 +395,13 @@ 'dark': false, 'notify': true, 'infinite': true - } + }, + followers: [], + followerCursor: 1, + followerMore: true, + following: [], + followingCursor: 1, + followingMore: true } }, @@ -812,6 +876,73 @@ modeInfiniteToggle() { this.modes.infinite = !this.modes.infinite window.ls.set('pixelfed-classicui-settings', this.modes); + }, + + followingModal() { + if(this.following.length > 0) { + this.$refs.followingModal.show(); + return; + } + axios.get('/api/v1/accounts/'+this.profile.id+'/following', { + params: { + page: this.followingCursor + } + }) + .then(res => { + this.following = res.data; + this.followingCursor++; + }); + this.$refs.followingModal.show(); + }, + + followersModal() { + if(this.followers.length > 0) { + this.$refs.followerModal.show(); + return; + } + axios.get('/api/v1/accounts/'+this.profile.id+'/followers', { + params: { + page: this.followerCursor + } + }) + .then(res => { + this.followers = res.data; + this.followerCursor++; + }) + this.$refs.followerModal.show(); + }, + + followingLoadMore() { + axios.get('/api/v1/accounts/'+this.profile.id+'/following', { + params: { + page: this.followingCursor + } + }) + .then(res => { + if(res.data.length > 0) { + this.following.push(...res.data); + this.followingCursor++; + } else { + this.followingMore = false; + } + }); + }, + + + followersLoadMore() { + axios.get('/api/v1/accounts/'+this.profile.id+'/followers', { + params: { + page: this.followerCursor + } + }) + .then(res => { + if(res.data.length > 0) { + this.followers.push(...res.data); + this.followerCursor++; + } else { + this.followerMore = false; + } + }); } } }