diff options
Diffstat (limited to 'web/react/components')
-rw-r--r-- | web/react/components/file_attachment.jsx | 15 | ||||
-rw-r--r-- | web/react/components/new_channel.jsx | 11 | ||||
-rw-r--r-- | web/react/components/post_right.jsx | 7 | ||||
-rw-r--r-- | web/react/components/view_image.jsx | 18 |
4 files changed, 40 insertions, 11 deletions
diff --git a/web/react/components/file_attachment.jsx b/web/react/components/file_attachment.jsx index c36c908d2..ab550d500 100644 --- a/web/react/components/file_attachment.jsx +++ b/web/react/components/file_attachment.jsx @@ -2,6 +2,7 @@ // See License.txt for license information. var utils = require('../utils/utils.jsx'); +var Client = require('../utils/client.jsx'); var Constants = require('../utils/constants.jsx'); module.exports = React.createClass({ @@ -103,12 +104,16 @@ module.exports = React.createClass({ if (this.state.fileSize < 0) { var self = this; - // asynchronously request the size of the file so that we can display it next to the thumbnail - utils.getFileSize(utils.getFileUrl(filename), function(fileSize) { - if (self.canSetState) { - self.setState({fileSize: fileSize}); + Client.getFileInfo( + filename, + function(data) { + if (self.canSetState) { + self.setState({fileSize: parseInt(data["size"], 10)}); + } + }, + function(err) { } - }); + ); } else { fileSizeString = utils.fileSizeToString(this.state.fileSize); } diff --git a/web/react/components/new_channel.jsx b/web/react/components/new_channel.jsx index 38c9ea76d..fc24a7cdc 100644 --- a/web/react/components/new_channel.jsx +++ b/web/react/components/new_channel.jsx @@ -84,6 +84,17 @@ module.exports = React.createClass({ var button = e.relatedTarget; self.setState({channelType: $(button).attr('data-channeltype')}); }); + $(this.refs.modal.getDOMNode()).on('hidden.bs.modal', this.handleClose); + }, + componentWillUnmount: function() { + $(this.refs.modal.getDOMNode()).off('hidden.bs.modal', this.handleClose); + }, + handleClose: function() { + $(this.getDOMNode()).find('.form-control').each(function clearForms() { + this.value = ''; + }); + + this.setState({channelType: '', displayNameError: '', nameError: '', serverError: '', inValid: false}); }, getInitialState: function() { return {channelType: ''}; diff --git a/web/react/components/post_right.jsx b/web/react/components/post_right.jsx index ac4c8a6d7..fb45ad28e 100644 --- a/web/react/components/post_right.jsx +++ b/web/react/components/post_right.jsx @@ -26,6 +26,13 @@ RhsHeaderPost = React.createClass({ }); AppDispatcher.handleServerAction({ + type: ActionTypes.RECIEVED_SEARCH_TERM, + term: null, + do_search: false, + is_mention_search: false + }); + + AppDispatcher.handleServerAction({ type: ActionTypes.RECIEVED_POST_SELECTED, results: null }); diff --git a/web/react/components/view_image.jsx b/web/react/components/view_image.jsx index 6077c4ebc..24efce0f1 100644 --- a/web/react/components/view_image.jsx +++ b/web/react/components/view_image.jsx @@ -224,18 +224,24 @@ module.exports = React.createClass({ </div> </div> ); + bgClass = 'white-bg'; // asynchronously request the actual size of this file if (!(filename in this.state.fileSizes)) { var self = this; - utils.getFileSize(utils.getFileUrl(filename), function fileSizeOp(fileSize) { - if (self.canSetState) { - var fileSizes = self.state.fileSizes; - fileSizes[filename] = fileSize; - self.setState(fileSizes); + Client.getFileInfo( + filename, + function(data) { + if (self.canSetState) { + var fileSizes = self.state.fileSizes; + fileSizes[filename] = parseInt(data["size"], 10); + self.setState(fileSizes); + } + }, + function(err) { } - }); + ); } } } else { |