From 134cea4e47563866eb9d8f40160c3e124221db4b Mon Sep 17 00:00:00 2001 From: Alina Beck Date: Tue, 15 Oct 2019 15:44:22 +0300 Subject: [PATCH] expand targeted comment by default --- webapp/components/Comment/Comment.vue | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/webapp/components/Comment/Comment.vue b/webapp/components/Comment/Comment.vue index ca7d1f741..a923f65ec 100644 --- a/webapp/components/Comment/Comment.vue +++ b/webapp/components/Comment/Comment.vue @@ -69,9 +69,14 @@ import scrollToAnchor from '~/mixins/scrollToAnchor.js' export default { mixins: [scrollToAnchor], - data: function() { + data() { + const anchor = `commentId-${this.comment.id}` + const isTarget = this.$route.hash === `#${anchor}` + return { - isCollapsed: true, + anchor, + isTarget, + isCollapsed: !isTarget, openEditCommentMenu: false, } }, @@ -96,9 +101,6 @@ export default { user: 'auth/user', isModerator: 'auth/isModerator', }), - isTarget() { - return this.$route.hash === `#${this.anchor}` - }, isLongComment() { return this.$filters.removeHtml(this.comment.content).length > 180 }, @@ -109,9 +111,6 @@ export default { return this.comment.content }, - anchor() { - return `commentId-${this.comment.id}` - }, displaysComment() { return !this.unavailable || this.isModerator },