fix: remove __fakeFileInput, clean up on destroy (#1025)
This commit is contained in:
parent
a63e85bf30
commit
44e3ea575e
|
@ -54,14 +54,10 @@
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
oncreate () {
|
oncreate () {
|
||||||
// for testing
|
window.__composeToolbar = this // for testing
|
||||||
window.__fakeFileInput = (file) => {
|
},
|
||||||
this.onFileChange({
|
ondestroy () {
|
||||||
target: {
|
window.__composeToolbar = null
|
||||||
files: [file]
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
IconButton,
|
IconButton,
|
||||||
|
|
|
@ -131,7 +131,9 @@ export const uploadKittenImage = i => (exec(() => {
|
||||||
let image = images[`kitten${i}`]
|
let image = images[`kitten${i}`]
|
||||||
let blob = blobUtils.base64StringToBlob(image.data, 'image/png')
|
let blob = blobUtils.base64StringToBlob(image.data, 'image/png')
|
||||||
blob.name = image.name
|
blob.name = image.name
|
||||||
window.__fakeFileInput(blob)
|
window.__composeToolbar.onFileChange({
|
||||||
|
target: { files: [blob] }
|
||||||
|
})
|
||||||
}, {
|
}, {
|
||||||
dependencies: {
|
dependencies: {
|
||||||
images,
|
images,
|
||||||
|
|
Loading…
Reference in a new issue