mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Get clear working properly
This commit is contained in:
parent
05d393064a
commit
7fafa1eb6e
@ -154,7 +154,10 @@
|
|||||||
</ds-button>
|
</ds-button>
|
||||||
</div>
|
</div>
|
||||||
</editor-floating-menu>
|
</editor-floating-menu>
|
||||||
<editor-content :editor="editor" />
|
<editor-content
|
||||||
|
ref="editor"
|
||||||
|
:editor="editor"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -445,6 +448,9 @@ export default {
|
|||||||
// remove link
|
// remove link
|
||||||
command({ href: null })
|
command({ href: null })
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
clear() {
|
||||||
|
this.editor.clearContent(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -107,7 +107,7 @@
|
|||||||
color="primary"
|
color="primary"
|
||||||
size="small"
|
size="small"
|
||||||
round
|
round
|
||||||
>{{ post.commentsCount }}</ds-tag> Comments
|
>{{ comments.length }}</ds-tag> Comments
|
||||||
</span>
|
</span>
|
||||||
</h3>
|
</h3>
|
||||||
</ds-flex-item>
|
</ds-flex-item>
|
||||||
@ -121,6 +121,7 @@
|
|||||||
<ds-card>
|
<ds-card>
|
||||||
<no-ssr>
|
<no-ssr>
|
||||||
<hc-editor
|
<hc-editor
|
||||||
|
ref="editor"
|
||||||
:users="users"
|
:users="users"
|
||||||
:value="form.content"
|
:value="form.content"
|
||||||
@input="updateEditorContent"
|
@input="updateEditorContent"
|
||||||
@ -133,7 +134,7 @@
|
|||||||
<ds-button
|
<ds-button
|
||||||
:disabled="loading || disabled"
|
:disabled="loading || disabled"
|
||||||
ghost
|
ghost
|
||||||
@click.prevent="clearEditor"
|
@click.prevent="clear"
|
||||||
>
|
>
|
||||||
{{ $t('actions.cancel') }}
|
{{ $t('actions.cancel') }}
|
||||||
</ds-button>
|
</ds-button>
|
||||||
@ -346,15 +347,13 @@ export default {
|
|||||||
}
|
}
|
||||||
this.$refs.commentForm.update('content', value)
|
this.$refs.commentForm.update('content', value)
|
||||||
},
|
},
|
||||||
clearEditor() {
|
clear() {
|
||||||
this.form.content = ' '
|
this.$refs.editor.clear()
|
||||||
},
|
},
|
||||||
addComment(comment) {
|
addComment(comment) {
|
||||||
this.$apollo.queries.CommentByPost.refetch()
|
this.$apollo.queries.CommentByPost.refetch()
|
||||||
},
|
},
|
||||||
handleSubmit() {
|
handleSubmit() {
|
||||||
const content = this.form.content
|
|
||||||
this.form.content = ' '
|
|
||||||
this.$apollo
|
this.$apollo
|
||||||
.mutate({
|
.mutate({
|
||||||
mutation: gql`
|
mutation: gql`
|
||||||
@ -367,11 +366,12 @@ export default {
|
|||||||
`,
|
`,
|
||||||
variables: {
|
variables: {
|
||||||
postId: this.post.id,
|
postId: this.post.id,
|
||||||
content
|
content: this.form.content
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.addComment(res.data.CreateComment)
|
this.addComment(res.data.CreateComment)
|
||||||
|
this.$refs.editor.clear()
|
||||||
this.loading = false
|
this.loading = false
|
||||||
this.disabled = false
|
this.disabled = false
|
||||||
this.$toast.success(this.$t('post.comment.submitted'))
|
this.$toast.success(this.$t('post.comment.submitted'))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user