From 373e248d6dc8f3cf358f6cb79512eee8bc95eacd Mon Sep 17 00:00:00 2001 From: nickago Date: Wed, 2 Sep 2015 13:13:37 -0700 Subject: bound handleClickImage function --- web/react/components/file_attachment_list.jsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'web/react/components/file_attachment_list.jsx') 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 { ); } - handleImageClick(e) { - this.setState({startImgId: parseInt($(e.target.parentNode).attr('data-img-id'), 10)}); - } } FileAttachmentList.propTypes = { -- cgit v1.2.3-1-g7c22