mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2026-04-06 01:25:31 +00:00
Disable Submit Button if comment is less than 3 characters
This commit is contained in:
parent
f6cf05743a
commit
05d393064a
@ -338,11 +338,15 @@ export default {
|
|||||||
return this.$store.getters['auth/user'].id === id
|
return this.$store.getters['auth/user'].id === id
|
||||||
},
|
},
|
||||||
updateEditorContent(value) {
|
updateEditorContent(value) {
|
||||||
|
const content = value.replace(/<(?:.|\n)*?>/gm, '').trim().length
|
||||||
|
if (content < 3) {
|
||||||
|
this.disabled = true
|
||||||
|
} else {
|
||||||
|
this.disabled = false
|
||||||
|
}
|
||||||
this.$refs.commentForm.update('content', value)
|
this.$refs.commentForm.update('content', value)
|
||||||
},
|
},
|
||||||
clearEditor() {
|
clearEditor() {
|
||||||
this.loading = false
|
|
||||||
this.disabled = false
|
|
||||||
this.form.content = ' '
|
this.form.content = ' '
|
||||||
},
|
},
|
||||||
addComment(comment) {
|
addComment(comment) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user