File input fixes

This commit is contained in:
Jai A
2020-12-06 17:41:45 -07:00
parent 40eca1727e
commit 1ff3b83766
7 changed files with 101 additions and 34 deletions

View File

@@ -393,7 +393,7 @@ export default {
license_id: this.license.short,
client_side: this.clientSideType.id,
server_side: this.serverSideType.id,
slug: this.mod.mod_slug,
slug: this.mod.slug,
}
if (this.isProcessing) {
@@ -431,9 +431,9 @@ export default {
this.$nuxt.$loading.finish()
},
showPreviewImage(e) {
showPreviewImage(files) {
const reader = new FileReader()
this.icon = e.target.files[0]
this.icon = files[0]
reader.readAsDataURL(this.icon)
reader.onload = (event) => {

View File

@@ -280,12 +280,12 @@ export default {
}
},
methods: {
updateVersionFiles(e) {
this.createdVersion.raw_files = e.target.files
updateVersionFiles(files) {
this.createdVersion.raw_files = files
const newFileParts = []
for (let i = 0; i < e.target.files.length; i++) {
newFileParts.push(e.target.files[i].name.concat('-' + i))
for (let i = 0; i < files.length; i++) {
newFileParts.push(files[i].name.concat('-' + i))
}
this.createdVersion.file_parts = newFileParts

View File

@@ -434,8 +434,8 @@
placeholder="Select one"
track-by="short"
label="name"
:options="availableLicenses"
:searchable="true"
:options="availableLicenses"
:close-on-select="true"
:show-labels="false"
/>
@@ -627,9 +627,9 @@ export default {
this.$nuxt.$loading.finish()
},
showPreviewImage(e) {
showPreviewImage(files) {
const reader = new FileReader()
this.icon = e.target.files[0]
this.icon = files[0]
reader.readAsDataURL(this.icon)
reader.onload = (event) => {
@@ -637,12 +637,12 @@ export default {
}
},
updateVersionFiles(e) {
this.versions[this.currentVersionIndex].raw_files = e.target.files
updateVersionFiles(files) {
this.versions[this.currentVersionIndex].raw_files = files
const newFileParts = []
for (let i = 0; i < e.target.files.length; i++) {
newFileParts.push(e.target.files[i].name.concat('-' + i))
for (let i = 0; i < files.length; i++) {
newFileParts.push(files[i].name.concat('-' + i))
}
this.versions[this.currentVersionIndex].file_parts = newFileParts