mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Merge pull request #562 from nickago/hotfix
bound handleClickImage function
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user