Merge pull request #562 from nickago/hotfix

bound handleClickImage function
This commit is contained in:
Corey Hulen
2015-09-02 13:16:24 -07:00

View File

@@ -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 = {