Added check to make sure files are not strings
Этот коммит содержится в:
@@ -84,13 +84,17 @@ module.exports = React.createClass({
|
||||
this.props.onUploadError(null);
|
||||
|
||||
var files = e.originalEvent.dataTransfer.files;
|
||||
if (files.length) {
|
||||
if (!files.length) {
|
||||
files = e.originalEvent.dataTransfer.getData('URL');
|
||||
}
|
||||
var channelId = this.props.channelId || ChannelStore.getCurrentId();
|
||||
|
||||
if (typeof files !== 'string' && files.length) {
|
||||
var numFiles = files.length;
|
||||
var numToUpload = this.props.setUploads(numFiles);
|
||||
|
||||
for (var i = 0; i < numFiles && i < numToUpload; i++) {
|
||||
var file = files[i];
|
||||
var channelId = this.props.channelId || ChannelStore.getCurrentId();
|
||||
|
||||
var formData = new FormData();
|
||||
formData.append('channel_id', channelId);
|
||||
|
||||
@@ -124,6 +124,7 @@ module.exports = React.createClass({
|
||||
$(this).parent('div').next('.date-separator, .new-separator').removeClass('hovered--comment');
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
componentDidUpdate: function() {
|
||||
this.resize();
|
||||
@@ -461,11 +462,6 @@ module.exports = React.createClass({
|
||||
postCtls.push(<LoadingScreen position="absolute" />);
|
||||
}
|
||||
|
||||
var fileDragOverlay = '';
|
||||
if (this.state.fileDrag) {
|
||||
fileDragOverlay = 'post-list-file-overlay';
|
||||
}
|
||||
|
||||
return (
|
||||
<div ref="postlist" className="post-list-holder-by-time">
|
||||
<div className="post-list__table">
|
||||
|
||||
@@ -294,13 +294,8 @@ module.exports = React.createClass({
|
||||
var currentId = UserStore.getCurrentId();
|
||||
var searchForm = currentId == null ? null : <SearchBox />;
|
||||
|
||||
var fileDragOverlay = '';
|
||||
if (this.state.fileDrag) {
|
||||
fileDragOverlay = 'post-right-file-overlay';
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="post-right__container ">
|
||||
<div className="post-right__container">
|
||||
<div className="search-bar__container sidebar--right__search-header">{searchForm}</div>
|
||||
<div className="sidebar-right__body">
|
||||
<RhsHeaderPost fromSearch={this.props.fromSearch} isMentionSearch={this.props.isMentionSearch} />
|
||||
|
||||
@@ -204,13 +204,9 @@
|
||||
}
|
||||
|
||||
.center-file-overlay {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background:rgba(255,255,255,0.5);
|
||||
}
|
||||
|
||||
.right-file-overlay {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background:rgba(255,255,255,0.5);
|
||||
}
|
||||
|
||||
@@ -107,11 +107,6 @@ body.ios {
|
||||
}
|
||||
|
||||
#post-list {
|
||||
.post-list-file-overlay {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background:rgba(255,255,255,0.5);
|
||||
}
|
||||
.post-list-holder-by-time {
|
||||
background: #fff;
|
||||
overflow-y: scroll;
|
||||
|
||||
Ссылка в новой задаче
Block a user