mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
WIP
- co-authored-by: mattwr18<mattwr18@gmail.com>
This commit is contained in:
parent
871c8e2aa3
commit
e11c87aba6
@ -198,6 +198,7 @@ export default {
|
||||
imageAspectRatio,
|
||||
categoryIds,
|
||||
} = this.form
|
||||
console.log(teaserImage)
|
||||
this.loading = true
|
||||
this.$apollo
|
||||
.mutate({
|
||||
|
||||
@ -85,6 +85,16 @@ export default {
|
||||
},
|
||||
transformImage(file) {
|
||||
this.file = file
|
||||
this.thumbnailElement = document.querySelectorAll('#postdropzone')[0]
|
||||
if (this.file.type === 'image/svg+xml') {
|
||||
console.log(this.file)
|
||||
this.image = new Image()
|
||||
this.image.src = this.file.dataURL
|
||||
this.image.classList.add('thumbnail-preview')
|
||||
this.thumbnailElement.appendChild(this.image)
|
||||
this.$emit('addTeaserImage', this.file)
|
||||
return
|
||||
}
|
||||
this.showCropper = true
|
||||
this.initEditor()
|
||||
this.initCropper()
|
||||
@ -95,7 +105,7 @@ export default {
|
||||
this.thumbnailElement.appendChild(this.editor)
|
||||
},
|
||||
clearImages() {
|
||||
this.thumbnailElement = document.querySelectorAll('#postdropzone')[0]
|
||||
//this.thumbnailElement = document.querySelectorAll('#postdropzone')[0]
|
||||
const thumbnailPreview = document.querySelectorAll('.thumbnail-preview')[0]
|
||||
if (thumbnailPreview) thumbnailPreview.remove()
|
||||
const contributionImage = document.querySelectorAll('.contribution-image')[0]
|
||||
@ -118,7 +128,7 @@ export default {
|
||||
const croppedImageFile = new File([blob], this.file.name, { type: this.file.type })
|
||||
this.$emit('addTeaserImage', croppedImageFile)
|
||||
this.$emit('addImageAspectRatio', imageAspectRatio)
|
||||
}, 'image/jpeg')
|
||||
}, this.file.type)
|
||||
},
|
||||
setupPreview(canvas) {
|
||||
this.image = new Image()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user