mirror of
https://github.com/docusealco/docuseal
synced 2026-11-04 14:42:32 -05:00
show alert when upload non pdf or image
This commit is contained in:
1 parent
7912c9a1ee
commit
7697b94f73
1 file changed
+6
-2
@@ -101,9 +101,13 @@ export default {
|
||||
methods: {
|
||||
upload: Upload.methods.upload,
|
||||
onDropFiles (e) {
|
||||
this.$refs.input.files = e.dataTransfer.files
|
||||
if ([...e.dataTransfer.files].every((f) => f.type.match(/(?:image\/)|(?:application\/pdf)/))) {
|
||||
this.$refs.input.files = e.dataTransfer.files
|
||||
|
||||
this.upload()
|
||||
this.upload()
|
||||
} else {
|
||||
alert('Only PDF and images are supported.')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user