Skip to content
This repository has been archived by the owner on Jan 29, 2019. It is now read-only.

Commit

Permalink
fix(drag+drop): fix for webkit
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsasharegan committed Oct 9, 2017
1 parent cd00eaf commit caa4683
Show file tree
Hide file tree
Showing 13 changed files with 52 additions and 55 deletions.
26 changes: 12 additions & 14 deletions dist/vue-transmit.browser.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/vue-transmit.browser.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/vue-transmit.browser.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/vue-transmit.browser.min.js.map

Large diffs are not rendered by default.

26 changes: 12 additions & 14 deletions dist/vue-transmit.common.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/vue-transmit.common.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/vue-transmit.common.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/vue-transmit.common.min.js.map

Large diffs are not rendered by default.

26 changes: 12 additions & 14 deletions dist/vue-transmit.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/vue-transmit.esm.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/vue-transmit.esm.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/vue-transmit.esm.min.js.map

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions src/components/VueTransmit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -787,14 +787,17 @@ export default class VueTransmit extends Vue {
}
this.$emit("drop", e)
const files = Array.from(e.dataTransfer.files)
this.$emit("added-files", files)
if (files.length) {
if (files.length && e.dataTransfer.items) {
const items = Array.from(e.dataTransfer.items)
if (items && items.length && items[0].webkitGetAsEntry) {
this.addFilesFromItems(items)
} else {
this.handleFiles(files)
}
} else {
this.handleFiles(files)
}
}
paste(e) {
Expand All @@ -808,7 +811,7 @@ export default class VueTransmit extends Vue {
}
}
handleFiles(files) {
return files.map(file => this.addFile(file))
return files.map(this.addFile)
}
addFilesFromItems(items) {
for (const item of items) {
Expand Down

0 comments on commit caa4683

Please sign in to comment.