Make saving a text edit a button

This commit is contained in:
kolaente 2021-08-18 22:57:11 +02:00
parent f8b3c2bb58
commit 08a34d8a68
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 17 additions and 3 deletions

View File

@ -20,17 +20,27 @@
</template>
</p>
<ul class="actions">
<template v-if="isEditEnabled && !showPreviewText">
<ul class="actions" v-if="bottomActions.length > 0">
<template v-if="isEditEnabled && !showPreviewText && showSave">
<li>
<a v-if="!isEditActive" @click="toggleEdit">{{ $t('input.editor.edit') }}</a>
<a v-else @click="toggleEdit" class="done-edit">{{ $t('input.editor.done') }}</a>
<a v-else @click="toggleEdit" class="done-edit">{{ $t('misc.save') }}</a>
</li>
</template>
<li v-for="(action, k) in bottomActions" :key="k">
<a @click="action.action">{{ action.title }}</a>
</li>
</ul>
<template v-else-if="showSave">
<ul v-if="!isEditActive" class="actions">
<li>
<a @click="toggleEdit">{{ $t('input.editor.edit') }}</a>
</li>
</ul>
<x-button v-else @click="toggleEdit" type="secondary" :shadow="false">
{{ $t('misc.save') }}
</x-button>
</template>
</div>
</template>
@ -85,6 +95,9 @@ export default {
type: String,
default: () => '',
},
showSave: {
default: true,
},
},
computed: {
showPreviewText() {

View File

@ -113,6 +113,7 @@
:upload-callback="attachmentUpload"
:upload-enabled="true"
:placeholder="$t('task.comment.placeholder')"
:show-save="false"
v-if="editorActive"
v-model="newComment.comment"
/>