diff options
author | Reed Garmsen <rgarmsen2295@gmail.com> | 2015-09-23 15:01:02 -0700 |
---|---|---|
committer | Reed Garmsen <rgarmsen2295@gmail.com> | 2015-09-23 15:01:02 -0700 |
commit | 03eece597d491ed9069fc684a03a980d9250844a (patch) | |
tree | f73060e7a112dbed09f8b78a3a09c5b63a186ddf /web/react/components/create_post.jsx | |
parent | ea0dcb44210226fb4fc8cbf165b73d06d70dad7d (diff) | |
download | chat-03eece597d491ed9069fc684a03a980d9250844a.tar.gz chat-03eece597d491ed9069fc684a03a980d9250844a.tar.bz2 chat-03eece597d491ed9069fc684a03a980d9250844a.zip |
Added support to drag and drop text into the main textbox or RHS textbox
Diffstat (limited to 'web/react/components/create_post.jsx')
-rw-r--r-- | web/react/components/create_post.jsx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/web/react/components/create_post.jsx b/web/react/components/create_post.jsx index abad60154..554e1ba35 100644 --- a/web/react/components/create_post.jsx +++ b/web/react/components/create_post.jsx @@ -31,6 +31,7 @@ export default class CreatePost 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.onChange = this.onChange.bind(this); this.getFileCount = this.getFileCount.bind(this); @@ -230,6 +231,11 @@ export default class CreatePost extends React.Component { this.setState({serverError: err}); } } + handleTextDrop(text) { + const originalText = this.state.messageText; + this.setState({messageText: originalText + text}); + React.findDOMNode(this.refs.textbox).focus(); + } removePreview(id) { let previews = this.state.previews; let uploadsInProgress = this.state.uploadsInProgress; @@ -334,6 +340,7 @@ export default class CreatePost extends React.Component { onUploadStart={this.handleUploadStart} onFileUpload={this.handleFileUploadComplete} onUploadError={this.handleUploadError} + onTextDrop={this.handleTextDrop} postType='post' channelId='' /> |