summaryrefslogtreecommitdiffstats
path: root/web/react/components/file_attachment_list.jsx
diff options
context:
space:
mode:
authorhmhealey <harrisonmhealey@gmail.com>2015-07-23 18:28:31 -0400
committerhmhealey <harrisonmhealey@gmail.com>2015-07-29 09:52:09 -0400
commitca2b73eac375d7037c50e96330f449de2f2381bc (patch)
tree7e10db51e5548179be4416e9ba83259afa654c35 /web/react/components/file_attachment_list.jsx
parente1257b781939bc8767b379e3e49a7f2ca7e52e7b (diff)
downloadchat-ca2b73eac375d7037c50e96330f449de2f2381bc.tar.gz
chat-ca2b73eac375d7037c50e96330f449de2f2381bc.tar.bz2
chat-ca2b73eac375d7037c50e96330f449de2f2381bc.zip
Fix ViewImageModals created by RHS posts so that their ids are distinct from those in the main window
Diffstat (limited to 'web/react/components/file_attachment_list.jsx')
-rw-r--r--web/react/components/file_attachment_list.jsx9
1 files changed, 4 insertions, 5 deletions
diff --git a/web/react/components/file_attachment_list.jsx b/web/react/components/file_attachment_list.jsx
index 0b52d6a70..3da1e1482 100644
--- a/web/react/components/file_attachment_list.jsx
+++ b/web/react/components/file_attachment_list.jsx
@@ -9,7 +9,7 @@ module.exports = React.createClass({
displayName: "FileAttachmentList",
propTypes: {
filenames: React.PropTypes.arrayOf(React.PropTypes.string).isRequired,
- postId: React.PropTypes.string.isRequired,
+ modalId: React.PropTypes.string.isRequired,
channelId: React.PropTypes.string,
userId: React.PropTypes.string
},
@@ -18,12 +18,11 @@ module.exports = React.createClass({
},
render: function() {
var filenames = this.props.filenames;
-
- var postImageModalId = "view_image_modal_" + this.props.postId;
+ var modalId = this.props.modalId;
var postFiles = [];
for (var i = 0; i < filenames.length && i < Constants.MAX_DISPLAY_FILES; i++) {
- postFiles.push(<FileAttachment key={i} filenames={filenames} index={i} imageModalId={postImageModalId} handleImageClick={this.handleImageClick} />);
+ postFiles.push(<FileAttachment key={i} filenames={filenames} index={i} modalId={modalId} handleImageClick={this.handleImageClick} />);
}
return (
@@ -34,7 +33,7 @@ module.exports = React.createClass({
<ViewImageModal
channelId={this.props.channelId}
userId={this.props.userId}
- modalId={postImageModalId}
+ modalId={modalId}
startId={this.state.startImgId}
imgCount={0}
filenames={filenames} />