diff --git a/webapp/components/Comment/Comment.vue b/webapp/components/Comment/Comment.vue index ab3230e97..35c6205ae 100644 --- a/webapp/components/Comment/Comment.vue +++ b/webapp/components/Comment/Comment.vue @@ -43,35 +43,12 @@ />
- - - - + + + + {{ isCollapsed ? $t('comment.show.more') : $t('comment.show.less') }} + +
@@ -119,6 +96,16 @@ export default { isTarget() { return this.$route.hash === `#${this.anchor}` }, + isLongComment() { + return this.$filters.removeHtml(this.comment.content).length > 180 + }, + commentContent() { + if (this.isLongComment && this.isCollapsed) { + return this.$filters.truncate(this.comment.content, 180) + } + + return this.comment.content + }, anchor() { return `commentId-${this.comment.id}` }, diff --git a/webapp/components/Editor/ContentViewer.vue b/webapp/components/Editor/ContentViewer.vue index ab07d11d6..b9a167df7 100644 --- a/webapp/components/Editor/ContentViewer.vue +++ b/webapp/components/Editor/ContentViewer.vue @@ -1,5 +1,5 @@