Update the scroll offset when images load

In order to deal with image-loading reshaping the DOM, wire up
ScrollPanel.checkScroll to the image load events.

Fixes https://github.com/vector-im/vector-web/issues/984
This commit is contained in:
Richard van der Hoff 2016-02-22 17:19:04 +00:00
parent 26e66326a2
commit 99d2392b6f
6 changed files with 57 additions and 12 deletions

View file

@ -31,6 +31,8 @@ module.exports = React.createClass({
// href for the highlights in this result
resultLink: React.PropTypes.string,
onImageLoad: React.PropTypes.func,
},
render: function() {
@ -53,7 +55,8 @@ module.exports = React.createClass({
}
if (EventTile.haveTileForEvent(ev)) {
ret.push(<EventTile key={eventId+"+"+j} mxEvent={ev} contextual={contextual} highlights={highlights}
highlightLink={this.props.resultLink}/>);
highlightLink={this.props.resultLink}
onImageLoad={this.props.onImageLoad} />);
}
}
return (