summaryrefslogtreecommitdiffstats
path: root/web/react/components/create_comment.jsx
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2015-09-24 09:17:59 -0400
committerHarrison Healey <harrisonmhealey@gmail.com>2015-09-24 09:17:59 -0400
commit4f371254c68fe41365f3c03001743a035bc63384 (patch)
tree6bebdde639c6612eed317c951e59abdb596996a7 /web/react/components/create_comment.jsx
parent90d1f4c6a130deeb7685b86bcce44472f9c7ece5 (diff)
parentef8705ab6b9f11da77d8056e68b9fc2adb2ef496 (diff)
downloadchat-4f371254c68fe41365f3c03001743a035bc63384.tar.gz
chat-4f371254c68fe41365f3c03001743a035bc63384.tar.bz2
chat-4f371254c68fe41365f3c03001743a035bc63384.zip
Merge pull request #771 from rgarmsen2295/plt-143
PLT-143 Support for text drag and drop
Diffstat (limited to 'web/react/components/create_comment.jsx')
-rw-r--r--web/react/components/create_comment.jsx7
1 files changed, 7 insertions, 0 deletions
diff --git a/web/react/components/create_comment.jsx b/web/react/components/create_comment.jsx
index c2fc0dcf3..99f553c0c 100644
--- a/web/react/components/create_comment.jsx
+++ b/web/react/components/create_comment.jsx
@@ -28,6 +28,7 @@ export default class CreateComment extends React.Component {
this.handleUploadStart = this.handleUploadStart.bind(this);
this.handleFileUploadComplete = this.handleFileUploadComplete.bind(this);
this.handleUploadError = this.handleUploadError.bind(this);
+ this.handleTextDrop = this.handleTextDrop.bind(this);
this.removePreview = this.removePreview.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
this.getFileCount = this.getFileCount.bind(this);
@@ -178,6 +179,11 @@ export default class CreateComment extends React.Component {
this.setState({serverError: err});
}
}
+ handleTextDrop(text) {
+ const newText = this.state.messageText + text;
+ this.handleUserInput(newText);
+ Utils.setCaretPosition(React.findDOMNode(this.refs.textbox.refs.message), newText.length);
+ }
removePreview(id) {
let previews = this.state.previews;
let uploadsInProgress = this.state.uploadsInProgress;
@@ -264,6 +270,7 @@ export default class CreateComment extends React.Component {
onUploadStart={this.handleUploadStart}
onFileUpload={this.handleFileUploadComplete}
onUploadError={this.handleUploadError}
+ onTextDrop={this.handleTextDrop}
postType='comment'
channelId={this.props.channelId}
/>