Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/text.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJulien Veyssier <eneiluj@posteo.net>2022-08-30 11:39:39 +0300
committerJulien Veyssier <eneiluj@posteo.net>2022-09-06 15:44:54 +0300
commit6f85b62c1cdf9de09f0abb03d073ab3ac65aabbf (patch)
tree14f8e0f66152b1840d08fe4dcf38287101e2f689 /src
parent95a4fbbb069655470d6d313d154aed994377d644 (diff)
use computed props to toggle delete icon
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
Diffstat (limited to 'src')
-rw-r--r--src/nodes/ImageView.vue11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/nodes/ImageView.vue b/src/nodes/ImageView.vue
index 8a7220e23..dcd1c11ae 100644
--- a/src/nodes/ImageView.vue
+++ b/src/nodes/ImageView.vue
@@ -48,7 +48,7 @@
{{ attachmentMetadata.size }}
</span>
</div>
- <div v-if="editor.isEditable && showIcons"
+ <div v-if="showDeleteIcon"
class="buttons">
<NcButton :aria-label="t('text', 'Delete this attachment')"
:title="t('text', 'Delete this attachment')"
@@ -78,7 +78,7 @@
class="image__caption__input"
:value="alt"
@keyup.enter="updateAlt">
- <div v-if="editor.isEditable && showIcons && !isMediaAttachment"
+ <div v-if="showImageDeleteIcon"
class="image__caption__delete">
<NcButton :aria-label="t('text', 'Delete this image')"
:title="t('text', 'Delete this image')"
@@ -186,6 +186,12 @@ export default {
isMediaAttachment() {
return this.attachmentType === this.$attachmentResolver.ATTACHMENT_TYPE_MEDIA
},
+ showDeleteIcon() {
+ return this.editor.isEditable && this.showIcons
+ },
+ showImageDeleteIcon() {
+ return this.showDeleteIcon && !this.isMediaAttachment
+ },
canDisplayImage() {
if (!this.isSupportedImage) {
return false
@@ -337,7 +343,6 @@ export default {
max-width: 80%;
border: none;
text-align: center;
- color: var(--color-text-maxcontrast);
background-color: transparent;
}
}