Edit Comment content not contentExcerpt

Comment button now only active, if the comment has changed.
Remove `console.log`.
This commit is contained in:
Wolfgang Huß 2019-07-16 09:46:01 +02:00
parent 75758ab2e7
commit 9203f7310d
2 changed files with 5 additions and 16 deletions

View File

@ -79,8 +79,6 @@ export default {
routes.push({
name: this.$t(`comment.menu.edit`),
callback: () => {
/* eslint-disable-next-line no-console */
console.log('EDIT COMMENT')
this.$emit('showEditCommentMenu', true)
},
icon: 'edit',

View File

@ -9,12 +9,7 @@
<ds-flex :gutter="{ base: 'small', md: 'small', sm: 'x-large', xs: 'x-large' }">
<ds-flex-item :width="{ base: '0%', md: '50%', sm: '0%', xs: '0%' }" />
<ds-flex-item :width="{ base: '40%', md: '20%', sm: '30%', xs: '30%' }">
<ds-button
:disabled="disabled"
ghost
class="cancelBtn"
@click.prevent="closeEditWindow"
>
<ds-button ghost class="cancelBtn" @click.prevent="closeEditWindow">
{{ $t('actions.cancel') }}
</ds-button>
</ds-flex-item>
@ -48,10 +43,10 @@ export default {
},
data() {
return {
disabled: false,
disabled: true,
loading: false,
form: {
content: this.comment.contentExcerpt,
content: this.comment.content,
},
users: [],
}
@ -61,12 +56,8 @@ export default {
setEditPending: 'editor/SET_EDIT_PENDING',
}),
updateEditorContent(value) {
const content = value.replace(/<(?:.|\n)*?>/gm, '').trim()
if (content.length < 1) {
this.disabled = true
} else {
this.disabled = false
}
const sanitizedContent = value.replace(/<(?:.|\n)*?>/gm, '').trim()
this.disabled = value === this.comment.content || sanitizedContent.length < 1
this.form.content = value
},
closeEditWindow() {