diff options
author | Mika Andrianarijaona <mikaoelitiana@users.noreply.github.com> | 2017-01-19 00:00:21 +0300 |
---|---|---|
committer | enahum <nahumhbl@gmail.com> | 2017-01-18 18:00:21 -0300 |
commit | 9eb57278413d4a4417e574f2bddb5bc0b2807d14 (patch) | |
tree | 3316c7482c24a7f47e994b42d8e7332002359592 /webapp/components/create_comment.jsx | |
parent | e15ae2253a15c7951c31ce0a2f9eea188ba2b639 (diff) | |
download | chat-9eb57278413d4a4417e574f2bddb5bc0b2807d14.tar.gz chat-9eb57278413d4a4417e574f2bddb5bc0b2807d14.tar.bz2 chat-9eb57278413d4a4417e574f2bddb5bc0b2807d14.zip |
PLT-137: Disable upload button when max uploads reached (#5053)
* Change upload button color opacity when max reached
* Display max upload message
* Remove error when deleting preview
* Clear error message in side-bar
when user reaches max upload and error is displayed in side-bar, removing one file won't remove error message
* Scroll in preview after file upload in sidebar
Diffstat (limited to 'webapp/components/create_comment.jsx')
-rw-r--r-- | webapp/components/create_comment.jsx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/webapp/components/create_comment.jsx b/webapp/components/create_comment.jsx index 0e9d2a41a..d9d66c8fa 100644 --- a/webapp/components/create_comment.jsx +++ b/webapp/components/create_comment.jsx @@ -331,6 +331,9 @@ export default class CreateComment extends React.Component { draft.fileInfos = draft.fileInfos.concat(fileInfos); PostStore.storeCommentDraft(this.props.rootId, draft); + // Focus on preview if needed + this.refs.preview.refs.container.scrollIntoViewIfNeeded(); + this.setState({uploadsInProgress: draft.uploadsInProgress, fileInfos: draft.fileInfos}); } @@ -355,6 +358,9 @@ export default class CreateComment extends React.Component { const fileInfos = this.state.fileInfos; const uploadsInProgress = this.state.uploadsInProgress; + // Clear previous errors + this.handleUploadError(null); + // id can either be the id of an uploaded file or the client id of an in progress upload let index = fileInfos.findIndex((info) => info.id === id); if (index === -1) { @@ -432,6 +438,7 @@ export default class CreateComment extends React.Component { fileInfos={this.state.fileInfos} onRemove={this.removePreview} uploadsInProgress={this.state.uploadsInProgress} + ref='preview' /> ); } |