mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Edit Comment content not contentExcerpt
Comment button now only active, if the comment has changed. Remove `console.log`.
This commit is contained in:
parent
75758ab2e7
commit
9203f7310d
@ -79,8 +79,6 @@ export default {
|
|||||||
routes.push({
|
routes.push({
|
||||||
name: this.$t(`comment.menu.edit`),
|
name: this.$t(`comment.menu.edit`),
|
||||||
callback: () => {
|
callback: () => {
|
||||||
/* eslint-disable-next-line no-console */
|
|
||||||
console.log('EDIT COMMENT')
|
|
||||||
this.$emit('showEditCommentMenu', true)
|
this.$emit('showEditCommentMenu', true)
|
||||||
},
|
},
|
||||||
icon: 'edit',
|
icon: 'edit',
|
||||||
|
|||||||
@ -9,12 +9,7 @@
|
|||||||
<ds-flex :gutter="{ base: 'small', md: 'small', sm: 'x-large', xs: 'x-large' }">
|
<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: '0%', md: '50%', sm: '0%', xs: '0%' }" />
|
||||||
<ds-flex-item :width="{ base: '40%', md: '20%', sm: '30%', xs: '30%' }">
|
<ds-flex-item :width="{ base: '40%', md: '20%', sm: '30%', xs: '30%' }">
|
||||||
<ds-button
|
<ds-button ghost class="cancelBtn" @click.prevent="closeEditWindow">
|
||||||
:disabled="disabled"
|
|
||||||
ghost
|
|
||||||
class="cancelBtn"
|
|
||||||
@click.prevent="closeEditWindow"
|
|
||||||
>
|
|
||||||
{{ $t('actions.cancel') }}
|
{{ $t('actions.cancel') }}
|
||||||
</ds-button>
|
</ds-button>
|
||||||
</ds-flex-item>
|
</ds-flex-item>
|
||||||
@ -48,10 +43,10 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
disabled: false,
|
disabled: true,
|
||||||
loading: false,
|
loading: false,
|
||||||
form: {
|
form: {
|
||||||
content: this.comment.contentExcerpt,
|
content: this.comment.content,
|
||||||
},
|
},
|
||||||
users: [],
|
users: [],
|
||||||
}
|
}
|
||||||
@ -61,12 +56,8 @@ export default {
|
|||||||
setEditPending: 'editor/SET_EDIT_PENDING',
|
setEditPending: 'editor/SET_EDIT_PENDING',
|
||||||
}),
|
}),
|
||||||
updateEditorContent(value) {
|
updateEditorContent(value) {
|
||||||
const content = value.replace(/<(?:.|\n)*?>/gm, '').trim()
|
const sanitizedContent = value.replace(/<(?:.|\n)*?>/gm, '').trim()
|
||||||
if (content.length < 1) {
|
this.disabled = value === this.comment.content || sanitizedContent.length < 1
|
||||||
this.disabled = true
|
|
||||||
} else {
|
|
||||||
this.disabled = false
|
|
||||||
}
|
|
||||||
this.form.content = value
|
this.form.content = value
|
||||||
},
|
},
|
||||||
closeEditWindow() {
|
closeEditWindow() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user