mirror of https://github.com/vector-im/riot-web
Merge remote-tracking branch 'origin/develop' into develop
commit
8061579385
|
@ -854,9 +854,13 @@ module.exports = React.createClass({
|
||||||
|
|
||||||
ev.dataTransfer.dropEffect = 'none';
|
ev.dataTransfer.dropEffect = 'none';
|
||||||
|
|
||||||
const items = ev.dataTransfer.items;
|
const items = [...ev.dataTransfer.items];
|
||||||
if (items.length == 1) {
|
if (items.length >= 1) {
|
||||||
if (items[0].kind == 'file') {
|
const isDraggingFiles = items.every(function(item) {
|
||||||
|
return item.kind == 'file';
|
||||||
|
});
|
||||||
|
|
||||||
|
if (isDraggingFiles) {
|
||||||
this.setState({ draggingFile: true });
|
this.setState({ draggingFile: true });
|
||||||
ev.dataTransfer.dropEffect = 'copy';
|
ev.dataTransfer.dropEffect = 'copy';
|
||||||
}
|
}
|
||||||
|
@ -867,10 +871,8 @@ module.exports = React.createClass({
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
this.setState({ draggingFile: false });
|
this.setState({ draggingFile: false });
|
||||||
const files = ev.dataTransfer.files;
|
const files = [...ev.dataTransfer.files];
|
||||||
if (files.length == 1) {
|
files.forEach(this.uploadFile);
|
||||||
this.uploadFile(files[0]);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onDragLeaveOrEnd: function(ev) {
|
onDragLeaveOrEnd: function(ev) {
|
||||||
|
|
Loading…
Reference in New Issue