From 6d1044d29235510b5c28e4193728ede1ac6cd5dd Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Mon, 21 Oct 2019 16:08:01 +0200 Subject: [PATCH] Hide new CommentForm while editing a comment --- webapp/components/Comment/Comment.vue | 1 + webapp/components/CommentList/CommentList.vue | 4 ++++ webapp/pages/post/_id/_slug/index.vue | 12 ++++++++++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/webapp/components/Comment/Comment.vue b/webapp/components/Comment/Comment.vue index a7be75b10..2da0df5fa 100644 --- a/webapp/components/Comment/Comment.vue +++ b/webapp/components/Comment/Comment.vue @@ -149,6 +149,7 @@ export default { }, editCommentMenu(showMenu) { this.openEditCommentMenu = showMenu + this.$emit('toggleNewCommentForm', !showMenu) }, updateComment(comment) { this.$emit('updateComment', comment) diff --git a/webapp/components/CommentList/CommentList.vue b/webapp/components/CommentList/CommentList.vue index b1a79fd21..df008e9ee 100644 --- a/webapp/components/CommentList/CommentList.vue +++ b/webapp/components/CommentList/CommentList.vue @@ -25,6 +25,7 @@ :routeHash="routeHash" @deleteComment="updateCommentList" @updateComment="updateCommentList" + @toggleNewCommentForm="toggleNewCommentForm" /> @@ -51,6 +52,9 @@ export default { return comment.id === updatedComment.id ? updatedComment : comment }) }, + toggleNewCommentForm(showNewCommentForm) { + this.$emit('toggleNewCommentForm', showNewCommentForm) + }, }, } diff --git a/webapp/pages/post/_id/_slug/index.vue b/webapp/pages/post/_id/_slug/index.vue index 0fdea08db..0b020076e 100644 --- a/webapp/pages/post/_id/_slug/index.vue +++ b/webapp/pages/post/_id/_slug/index.vue @@ -70,9 +70,13 @@ - + - + @@ -119,6 +123,7 @@ export default { post: null, ready: false, title: 'loading', + showNewCommentForm: true, } }, watch: { @@ -181,6 +186,9 @@ export default { }) .catch(error => this.$toast.error(error.message)) }, + toggleNewCommentForm(showNewCommentForm) { + this.showNewCommentForm = showNewCommentForm + }, }, apollo: { Post: {