Make saving a text edit a button
This commit is contained in:
parent
f8b3c2bb58
commit
08a34d8a68
2 changed files with 17 additions and 3 deletions
|
@ -20,17 +20,27 @@
|
||||||
</template>
|
</template>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<ul class="actions">
|
<ul class="actions" v-if="bottomActions.length > 0">
|
||||||
<template v-if="isEditEnabled && !showPreviewText">
|
<template v-if="isEditEnabled && !showPreviewText && showSave">
|
||||||
<li>
|
<li>
|
||||||
<a v-if="!isEditActive" @click="toggleEdit">{{ $t('input.editor.edit') }}</a>
|
<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>
|
</li>
|
||||||
</template>
|
</template>
|
||||||
<li v-for="(action, k) in bottomActions" :key="k">
|
<li v-for="(action, k) in bottomActions" :key="k">
|
||||||
<a @click="action.action">{{ action.title }}</a>
|
<a @click="action.action">{{ action.title }}</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -85,6 +95,9 @@ export default {
|
||||||
type: String,
|
type: String,
|
||||||
default: () => '',
|
default: () => '',
|
||||||
},
|
},
|
||||||
|
showSave: {
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
showPreviewText() {
|
showPreviewText() {
|
||||||
|
|
|
@ -113,6 +113,7 @@
|
||||||
:upload-callback="attachmentUpload"
|
:upload-callback="attachmentUpload"
|
||||||
:upload-enabled="true"
|
:upload-enabled="true"
|
||||||
:placeholder="$t('task.comment.placeholder')"
|
:placeholder="$t('task.comment.placeholder')"
|
||||||
|
:show-save="false"
|
||||||
v-if="editorActive"
|
v-if="editorActive"
|
||||||
v-model="newComment.comment"
|
v-model="newComment.comment"
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Reference in a new issue