diff options
author | nickago <ngonella@calpoly.edu> | 2015-09-02 13:13:37 -0700 |
---|---|---|
committer | nickago <ngonella@calpoly.edu> | 2015-09-02 13:13:37 -0700 |
commit | 373e248d6dc8f3cf358f6cb79512eee8bc95eacd (patch) | |
tree | c62c54995c5d969d0b695a5ef126e598185fbe43 /web | |
parent | ff638e460fd33d7b44c0aaa0fa44951c416be428 (diff) | |
download | chat-373e248d6dc8f3cf358f6cb79512eee8bc95eacd.tar.gz chat-373e248d6dc8f3cf358f6cb79512eee8bc95eacd.tar.bz2 chat-373e248d6dc8f3cf358f6cb79512eee8bc95eacd.zip |
bound handleClickImage function
Diffstat (limited to 'web')
-rw-r--r-- | web/react/components/file_attachment_list.jsx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/web/react/components/file_attachment_list.jsx b/web/react/components/file_attachment_list.jsx index 33643de73..d93f461e8 100644 --- a/web/react/components/file_attachment_list.jsx +++ b/web/react/components/file_attachment_list.jsx @@ -8,8 +8,14 @@ var Constants = require('../utils/constants.jsx'); export default class FileAttachmentList extends React.Component { constructor(props) { super(props); + + this.handleImageClick = this.handleImageClick.bind(this); + this.state = {startImgId: 0}; } + handleImageClick(e) { + this.setState({startImgId: parseInt($(e.target.parentNode).attr('data-img-id'), 10)}); + } render() { var filenames = this.props.filenames; var modalId = this.props.modalId; @@ -40,9 +46,6 @@ export default class FileAttachmentList extends React.Component { </div> ); } - handleImageClick(e) { - this.setState({startImgId: parseInt($(e.target.parentNode).attr('data-img-id'), 10)}); - } } FileAttachmentList.propTypes = { |