fix: delete picture and thumbnail in post

This commit is contained in:
ogerly 2020-01-15 18:48:37 +01:00
parent af760c17ea
commit 75753444ea
3 changed files with 9 additions and 6 deletions

View File

@ -10,10 +10,11 @@
<ds-button
@click.prevent="deleteImage"
icon="close"
v-if="showDeleteButton"
v-if="contribution.image || form.teaserImage"
class="delete-image"
></ds-button>
<hc-teaser-image
ref="deleteImage"
:contribution="contribution"
@addTeaserImage="addTeaserImage"
:class="{ '--blur-image': form.blurImage }"
@ -204,7 +205,6 @@ export default {
users: [],
contentMin: 3,
hashtags: [],
showDeleteButton: !!this.contribution,
elem: null,
}
},
@ -272,9 +272,10 @@ export default {
return categories.map(c => c.id)
},
deleteImage() {
this.form.image = null
this.contribution.image = null
this.showDeleteButton = false
this.form.image = null
this.form.teaserImage = null
this.$refs.deleteImage.deleteImage()
},
},
apollo: {

View File

@ -71,6 +71,9 @@ export default {
},
},
methods: {
deleteImage() {
this.clearImages()
},
template() {
return `<div class="dz-preview dz-file-preview">
<div class="dz-image">
@ -207,7 +210,7 @@ export default {
}
.hc-drag-marker-update-post {
opacity: 0;
opacity: 0.1;
}
.contribution-form-footer {

View File

@ -157,7 +157,6 @@ export default {
border-radius: 100%;
border: 1px dashed hsl(0, 0%, 25%);
}
.hc-attachments-upload-area:hover & {
opacity: 1;
}