From 1646b640c98698afeb09de3cda8713f3ea73136f Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 3 Sep 2019 19:36:39 -0600 Subject: [PATCH] Update PostComponent.vue --- .../assets/js/components/PostComponent.vue | 170 ++++++++++++++---- 1 file changed, 135 insertions(+), 35 deletions(-) diff --git a/resources/assets/js/components/PostComponent.vue b/resources/assets/js/components/PostComponent.vue index 06837f1a..75dd40b0 100644 --- a/resources/assets/js/components/PostComponent.vue +++ b/resources/assets/js/components/PostComponent.vue @@ -74,14 +74,15 @@
- -
- +
@@ -266,38 +268,123 @@
-
-
-
-

-

-

+
+
+
+
+
+
+ +
+
+
+
+ +
-
- - likes - - - shares - -
-
-
- avatar -
- by {{statusUsername}} + +
+
+

+ {{status.content.length < 100 ? status.content.slice(0,100) : 'Untitled Post'}} +

+

+ by {{statusUsername}} + +

+ avatar

-

{{timestampFormat()}}

-
+

+ + {{status.place.name}}, {{status.place.country}} + + + {{timeAgo(status.created_at)}} ago + +

+ + +
+

+ {{tag.name}} +

+
-
-
-

Comments have been disabled on this post.

-
+
+

Comments

+
+
+ +

+ + {{replyText.length}}/{{config.uploader.max_caption_length}} + + +

+
+
+
+
+
+ avatar +
+
+ {{reply.account.username}} + + {{timeAgo(reply.created_at)}} + +
+

+
+
+ +
@@ -378,8 +465,8 @@ size="lg" body-class="p-0" > -
- +
+
@@ -472,6 +559,7 @@ export default { ], data() { return { + config: window.App.config, status: false, media: {}, user: false, @@ -787,11 +875,18 @@ export default { item: this.replyingToId, comment: this.replyText } + + this.replyText = ''; + axios.post('/i/comment', data) .then(function(res) { let entity = res.data.entity; if(entity.in_reply_to_id == self.status.id) { - self.results.push(entity); + if(self.profileLayout == 'metro') { + self.results.push(entity); + } else { + self.results.unshift(entity); + } let elem = $('.status-comments')[0]; elem.scrollTop = elem.clientHeight; } else { @@ -801,7 +896,6 @@ export default { el.reply_count = el.reply_count + 1; } } - self.replyText = ''; }); }, @@ -847,7 +941,9 @@ export default { axios.get(url) .then(response => { let self = this; - this.results = _.reverse(response.data.data); + this.results = this.profileLayout == 'metro' ? + _.reverse(response.data.data) : + response.data.data; this.pagination = response.data.meta.pagination; if(this.results.length > 0) { $('.load-more-link').removeClass('d-none'); @@ -1054,6 +1150,10 @@ export default { reply.thread = true; }); } + }, + + redirect(url) { + window.location.href = url; } },