summaryrefslogtreecommitdiffstats
path: root/web/react/components/create_comment.jsx
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-08-18 08:46:14 -0400
committerChristopher Speller <crspeller@gmail.com>2015-08-18 08:46:14 -0400
commit96d1eb1c800a427e31e63970e57d0824a3bc91e3 (patch)
tree4bf9b926fa3877de9bafaafcc0831e724e6fc7a3 /web/react/components/create_comment.jsx
parentab197e98358f4f48b81669182a361b6641132029 (diff)
parent2c098d7711eda893f903329ab64528a7d387a6e8 (diff)
downloadchat-96d1eb1c800a427e31e63970e57d0824a3bc91e3.tar.gz
chat-96d1eb1c800a427e31e63970e57d0824a3bc91e3.tar.bz2
chat-96d1eb1c800a427e31e63970e57d0824a3bc91e3.zip
Merge pull request #378 from rgarmsen2295/mm-316c
MM-316 Allows users to drag and drop files from their computer to the center pane or RHS to upload them
Diffstat (limited to 'web/react/components/create_comment.jsx')
-rw-r--r--web/react/components/create_comment.jsx22
1 files changed, 14 insertions, 8 deletions
diff --git a/web/react/components/create_comment.jsx b/web/react/components/create_comment.jsx
index 78e06c532..885efab7a 100644
--- a/web/react/components/create_comment.jsx
+++ b/web/react/components/create_comment.jsx
@@ -122,16 +122,20 @@ module.exports = React.createClass({
this.setState({uploadsInProgress: draft['uploadsInProgress'], previews: draft['previews']});
},
handleUploadError: function(err, clientId) {
- var draft = PostStore.getCommentDraft(this.props.rootId);
+ if (clientId !== -1) {
+ var draft = PostStore.getCommentDraft(this.props.rootId);
- var index = draft['uploadsInProgress'].indexOf(clientId);
- if (index !== -1) {
- draft['uploadsInProgress'].splice(index, 1);
- }
+ var index = draft['uploadsInProgress'].indexOf(clientId);
+ if (index !== -1) {
+ draft['uploadsInProgress'].splice(index, 1);
+ }
- PostStore.storeCommentDraft(this.props.rootId, draft);
+ PostStore.storeCommentDraft(this.props.rootId, draft);
- this.setState({uploadsInProgress: draft['uploadsInProgress'], serverError: err});
+ this.setState({uploadsInProgress: draft['uploadsInProgress'], serverError: err});
+ } else {
+ this.setState({serverError: err});
+ }
},
clearPreviews: function() {
this.setState({previews: []});
@@ -222,7 +226,9 @@ module.exports = React.createClass({
getFileCount={this.getFileCount}
onUploadStart={this.handleUploadStart}
onFileUpload={this.handleFileUploadComplete}
- onUploadError={this.handleUploadError} />
+ onUploadError={this.handleUploadError}
+ postType='comment'
+ channelId={this.props.channelId} />
</div>
<MsgTyping channelId={this.props.channelId} parentId={this.props.rootId} />
<div className={postFooterClassName}>