mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Hide new CommentForm while editing a comment
This commit is contained in:
parent
46fd534a28
commit
6d1044d292
@ -149,6 +149,7 @@ export default {
|
|||||||
},
|
},
|
||||||
editCommentMenu(showMenu) {
|
editCommentMenu(showMenu) {
|
||||||
this.openEditCommentMenu = showMenu
|
this.openEditCommentMenu = showMenu
|
||||||
|
this.$emit('toggleNewCommentForm', !showMenu)
|
||||||
},
|
},
|
||||||
updateComment(comment) {
|
updateComment(comment) {
|
||||||
this.$emit('updateComment', comment)
|
this.$emit('updateComment', comment)
|
||||||
|
|||||||
@ -25,6 +25,7 @@
|
|||||||
:routeHash="routeHash"
|
:routeHash="routeHash"
|
||||||
@deleteComment="updateCommentList"
|
@deleteComment="updateCommentList"
|
||||||
@updateComment="updateCommentList"
|
@updateComment="updateCommentList"
|
||||||
|
@toggleNewCommentForm="toggleNewCommentForm"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -51,6 +52,9 @@ export default {
|
|||||||
return comment.id === updatedComment.id ? updatedComment : comment
|
return comment.id === updatedComment.id ? updatedComment : comment
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
toggleNewCommentForm(showNewCommentForm) {
|
||||||
|
this.$emit('toggleNewCommentForm', showNewCommentForm)
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -70,9 +70,13 @@
|
|||||||
</ds-space>
|
</ds-space>
|
||||||
<!-- Comments -->
|
<!-- Comments -->
|
||||||
<ds-section slot="footer">
|
<ds-section slot="footer">
|
||||||
<hc-comment-list :post="post" :routeHash="$route.hash" />
|
<hc-comment-list
|
||||||
|
:post="post"
|
||||||
|
:routeHash="$route.hash"
|
||||||
|
@toggleNewCommentForm="toggleNewCommentForm"
|
||||||
|
/>
|
||||||
<ds-space margin-bottom="large" />
|
<ds-space margin-bottom="large" />
|
||||||
<hc-comment-form :post="post" @createComment="createComment" />
|
<hc-comment-form v-if="showNewCommentForm" :post="post" @createComment="createComment" />
|
||||||
</ds-section>
|
</ds-section>
|
||||||
</ds-card>
|
</ds-card>
|
||||||
</transition>
|
</transition>
|
||||||
@ -119,6 +123,7 @@ export default {
|
|||||||
post: null,
|
post: null,
|
||||||
ready: false,
|
ready: false,
|
||||||
title: 'loading',
|
title: 'loading',
|
||||||
|
showNewCommentForm: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -181,6 +186,9 @@ export default {
|
|||||||
})
|
})
|
||||||
.catch(error => this.$toast.error(error.message))
|
.catch(error => this.$toast.error(error.message))
|
||||||
},
|
},
|
||||||
|
toggleNewCommentForm(showNewCommentForm) {
|
||||||
|
this.showNewCommentForm = showNewCommentForm
|
||||||
|
},
|
||||||
},
|
},
|
||||||
apollo: {
|
apollo: {
|
||||||
Post: {
|
Post: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user