From a0c5bbf8229c995c7d12c5ee3dee4ed0966bbf3f Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 22 Apr 2019 21:50:06 -0600 Subject: [PATCH] Update NotificationCard --- .../assets/js/components/NotificationCard.vue | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/resources/assets/js/components/NotificationCard.vue b/resources/assets/js/components/NotificationCard.vue index 69dc8e228..65c1fbe18 100644 --- a/resources/assets/js/components/NotificationCard.vue +++ b/resources/assets/js/components/NotificationCard.vue @@ -18,27 +18,27 @@

- {{n.account.username}} liked your post. + {{truncate(n.account.username)}} liked your post.

- {{n.account.username}} commented on your post. + {{truncate(n.account.username)}} commented on your post.

- {{n.account.username}} mentioned you. + {{truncate(n.account.username)}} mentioned you.

- {{n.account.username}} followed you. + {{truncate(n.account.username)}} followed you.

- {{n.account.username}} shared your post. + {{truncate(n.account.username)}} shared your post.

@@ -73,6 +73,10 @@ this.fetchNotifications(); }, + updated() { + $('[data-toggle="tooltip"]').tooltip() + }, + methods: { fetchNotifications() { axios.get('/api/v1/notifications') @@ -114,6 +118,14 @@ } }); }, + + truncate(text) { + if(text.length <= 15) { + return text; + } + + return text.slice(0,15) + '...' + } } } \ No newline at end of file