diff --git a/webapp/components/TeaserImage/TeaserImage.vue b/webapp/components/TeaserImage/TeaserImage.vue index cb4a16001..5b46de5e4 100644 --- a/webapp/components/TeaserImage/TeaserImage.vue +++ b/webapp/components/TeaserImage/TeaserImage.vue @@ -9,22 +9,20 @@ @vdropzone-thumbnail="transformImage" @vdropzone-drop="dropzoneDrop" > -
+
+
- -
- -
+
@@ -45,7 +43,7 @@ export default { data() { return { dropzoneOptions: { - url: this.addTeaserImage, + url: () => '', maxFilesize: 5.0, previewTemplate: this.template(), }, @@ -73,15 +71,11 @@ export default { this.error = true this.$toast.error(file.status, message) }, - addTeaserImage(file) { - this.$emit('addTeaserImage', file[0]) - return '' - }, transformImage(file) { let thumbnailElement, editor, confirm, thumbnailPreview, contributionImage // Create the image editor overlay editor = document.createElement('div') - thumbnailElement = document.querySelectorAll('.dz-image')[0] + thumbnailElement = document.querySelectorAll('#postdropzone')[0] thumbnailPreview = document.querySelectorAll('.thumbnail-preview')[0] if (thumbnailPreview) thumbnailPreview.remove() contributionImage = document.querySelectorAll('.contribution-image')[0] @@ -106,7 +100,7 @@ export default { thumbnailElement.appendChild(image) // Remove the editor from view editor.parentNode.removeChild(editor) - this.addTeaserImage([blob]) + this.$emit('addTeaserImage', blob) }) }) editor.appendChild(confirm) @@ -128,7 +122,7 @@ export default {