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