#312 - media uploader not working with same file in adjacent order

This commit is contained in:
dave 2019-02-04 10:45:26 -05:00
parent bb335ea71b
commit 97fbc1d402
4 changed files with 17 additions and 13 deletions

View file

@ -3,19 +3,10 @@ import statusPosterService from '../../services/status_poster/status_poster.serv
import fileSizeFormatService from '../../services/file_size_format/file_size_format.js'
const mediaUpload = {
mounted () {
const input = this.$el.querySelector('input')
input.addEventListener('change', ({target}) => {
for (var i = 0; i < target.files.length; i++) {
let file = target.files[i]
this.uploadFile(file)
}
})
},
data () {
return {
uploading: false
uploading: false,
uploadReady: true
}
},
methods: {
@ -56,6 +47,18 @@ const mediaUpload = {
} else {
e.dataTransfer.dropEffect = 'none'
}
},
clearFile () {
this.uploadReady = false
this.$nextTick(() => {
this.uploadReady = true
})
},
change ({target}) {
for (var i = 0; i < target.files.length; i++) {
let file = target.files[i]
this.uploadFile(file)
}
}
},
props: [