fix(editor): duplicate edit buttons for empty descriptions
Resolves #821
This commit is contained in:
parent
22ef7785fd
commit
19a561c8e6
1 changed files with 8 additions and 5 deletions
|
@ -13,7 +13,7 @@
|
||||||
<div class="preview content" v-html="preview" v-if="isPreviewActive && text !== ''">
|
<div class="preview content" v-html="preview" v-if="isPreviewActive && text !== ''">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p class="has-text-centered has-text-grey is-italic" v-if="showPreviewText">
|
<p class="has-text-centered has-text-grey is-italic my-5" v-if="showPreviewText">
|
||||||
{{ emptyText }}
|
{{ emptyText }}
|
||||||
<template v-if="isEditEnabled">
|
<template v-if="isEditEnabled">
|
||||||
<a @click="toggleEdit">{{ $t('input.editor.edit') }}</a>.
|
<a @click="toggleEdit">{{ $t('input.editor.edit') }}</a>.
|
||||||
|
@ -23,8 +23,8 @@
|
||||||
<ul class="actions" v-if="bottomActions.length > 0">
|
<ul class="actions" v-if="bottomActions.length > 0">
|
||||||
<template v-if="isEditEnabled && !showPreviewText && showSave">
|
<template v-if="isEditEnabled && !showPreviewText && showSave">
|
||||||
<li>
|
<li>
|
||||||
<a v-if="!isEditActive" @click="toggleEdit">{{ $t('input.editor.edit') }}</a>
|
<a v-if="showEditButton" @click="toggleEdit">{{ $t('input.editor.edit') }}</a>
|
||||||
<a v-else @click="toggleEdit" class="done-edit">{{ $t('misc.save') }}</a>
|
<a v-else-if="isEditActive" @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">
|
||||||
|
@ -32,12 +32,12 @@
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<template v-else-if="isEditEnabled && showSave">
|
<template v-else-if="isEditEnabled && showSave">
|
||||||
<ul v-if="!isEditActive" class="actions">
|
<ul v-if="showEditButton" class="actions">
|
||||||
<li>
|
<li>
|
||||||
<a @click="toggleEdit">{{ $t('input.editor.edit') }}</a>
|
<a @click="toggleEdit">{{ $t('input.editor.edit') }}</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<x-button v-else @click="toggleEdit" type="secondary" :shadow="false">
|
<x-button v-else-if="isEditActive" @click="toggleEdit" type="secondary" :shadow="false">
|
||||||
{{ $t('misc.save') }}
|
{{ $t('misc.save') }}
|
||||||
</x-button>
|
</x-button>
|
||||||
</template>
|
</template>
|
||||||
|
@ -105,6 +105,9 @@ export default {
|
||||||
showPreviewText() {
|
showPreviewText() {
|
||||||
return this.isPreviewActive && this.text === '' && this.emptyText !== ''
|
return this.isPreviewActive && this.text === '' && this.emptyText !== ''
|
||||||
},
|
},
|
||||||
|
showEditButton() {
|
||||||
|
return !this.isEditActive && this.text !== ''
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in a new issue