Use VueEasyMDE initialized event instead of setTimeout as proposed by @juliushaertl
Signed-off-by: ben <ben@ro.tt>
This commit is contained in:
@@ -60,6 +60,7 @@
|
|||||||
ref="markdownEditor"
|
ref="markdownEditor"
|
||||||
v-model="description"
|
v-model="description"
|
||||||
:configs="mdeConfig"
|
:configs="mdeConfig"
|
||||||
|
@initialized="addKeyListeners"
|
||||||
@update:modelValue="updateDescription"
|
@update:modelValue="updateDescription"
|
||||||
@blur="saveDescription" />
|
@blur="saveDescription" />
|
||||||
|
|
||||||
@@ -175,15 +176,7 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
showEditor() {
|
addKeyListeners() {
|
||||||
if (!this.canEdit) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.descriptionEditing = true
|
|
||||||
this.description = this.card.description
|
|
||||||
|
|
||||||
// Has to start after the Editor is fully loaded. This shouldn't take longer than 1/4 second
|
|
||||||
setTimeout(() => {
|
|
||||||
this.$refs.markdownEditor.easymde.codemirror.on('keydown', (a, b) => {
|
this.$refs.markdownEditor.easymde.codemirror.on('keydown', (a, b) => {
|
||||||
|
|
||||||
if (this.keyExitState === 0 && (b.key === 'Meta' || b.key === 'Alt')) {
|
if (this.keyExitState === 0 && (b.key === 'Meta' || b.key === 'Alt')) {
|
||||||
@@ -202,7 +195,13 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
}, 250)
|
},
|
||||||
|
showEditor() {
|
||||||
|
if (!this.canEdit) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.descriptionEditing = true
|
||||||
|
this.description = this.card.description
|
||||||
|
|
||||||
},
|
},
|
||||||
hideEditor() {
|
hideEditor() {
|
||||||
|
|||||||
Reference in New Issue
Block a user