summaryrefslogtreecommitdiffstats
path: root/web/react
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2015-09-02 13:16:24 -0700
committerCorey Hulen <corey@hulen.com>2015-09-02 13:16:24 -0700
commit9a1d3986c5ab79b03fcf55616b6dbc0b01e7c46e (patch)
treec62c54995c5d969d0b695a5ef126e598185fbe43 /web/react
parentff638e460fd33d7b44c0aaa0fa44951c416be428 (diff)
parent373e248d6dc8f3cf358f6cb79512eee8bc95eacd (diff)
downloadchat-9a1d3986c5ab79b03fcf55616b6dbc0b01e7c46e.tar.gz
chat-9a1d3986c5ab79b03fcf55616b6dbc0b01e7c46e.tar.bz2
chat-9a1d3986c5ab79b03fcf55616b6dbc0b01e7c46e.zip
Merge pull request #562 from nickago/hotfix
bound handleClickImage function
Diffstat (limited to 'web/react')
-rw-r--r--web/react/components/file_attachment_list.jsx9
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 = {