Enter edit mode when double clicking

This commit is contained in:
Elscrux 2024-04-11 00:39:04 +02:00
parent 61ee0bd5e2
commit 176ad1cabe
1 changed files with 8 additions and 0 deletions

View File

@ -67,6 +67,7 @@
class="tiptap__editor"
:class="{'tiptap__editor-is-edit-enabled': isEditing}"
:editor="editor"
@dblclick="setEditIfApplicable()"
@click="focusIfEditing()"
/>
@ -465,6 +466,13 @@ function bubbleSave() {
}
}
function setEditIfApplicable() {
if (!isEditEnabled) return
if (isEditing.value) return
setEdit()
}
function setEdit(focus: boolean = true) {
internalMode.value = 'edit'
if (focus) {