ForceUpdate the scrollpanel when the aux panel changes size

Catch some more cases when we ought to be updating the gemini scroll stuff.
This commit is contained in:
Richard van der Hoff 2016-03-08 12:16:34 +00:00
parent 393e8ff612
commit 6c928f12b2
3 changed files with 38 additions and 19 deletions

View file

@ -18,6 +18,7 @@ var React = require('react');
var MatrixClientPeg = require("../../../MatrixClientPeg");
var sdk = require('../../../index');
var dis = require("../../../dispatcher");
var ObjectUtils = require('../../../ObjectUtils');
module.exports = React.createClass({
displayName: 'AuxPanel',
@ -39,9 +40,21 @@ module.exports = React.createClass({
// therein
maxHeight: React.PropTypes.number,
// a callback which is called when the video element in a voip call is
// resized due to a change in video metadata
onCallViewVideoResize: React.PropTypes.func,
// a callback which is called when the content of the aux panel changes
// content in a way that is likely to make it change size.
onResize: React.PropTypes.func,
},
shouldComponentUpdate: function(nextProps, nextState) {
return (!ObjectUtils.shallowEqual(this.props, nextProps) ||
!ObjectUtils.shallowEqual(this.state, nextState));
},
componentDidUpdate: function(prevProps, prevState) {
// most changes are likely to cause a resize
if (this.props.onResize) {
this.props.onResize();
}
},
onConferenceNotificationClick: function() {
@ -87,7 +100,7 @@ module.exports = React.createClass({
var callView = (
<CallView ref="callView" room={this.props.room}
ConferenceHandler={this.props.conferenceHandler}
onResize={this.props.onCallViewVideoResize}
onResize={this.props.onResize}
maxVideoHeight={this.props.maxHeight}
/>
);