Merge pull request #203 from matrix-org/rav/optimize_resize
Don't forceUpdate the message panel on resize
This commit is contained in:
commit
a9da0a014e
3 changed files with 19 additions and 1 deletions
|
@ -159,6 +159,17 @@ module.exports = React.createClass({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// makes the MessagePanel update itself after it is resized (due to other
|
||||||
|
// changes in the DOM)
|
||||||
|
onResize: function() {
|
||||||
|
if (!this.refs.scrollPanel) { return; }
|
||||||
|
|
||||||
|
// we don't need to forceUpdate ourselves here, but we do need to
|
||||||
|
// forceUpdate the scrollpanel, which will make the gemini panel update
|
||||||
|
// itself and trigger a scroll position check.
|
||||||
|
this.refs.scrollPanel.forceUpdate();
|
||||||
|
},
|
||||||
|
|
||||||
_getEventTiles: function() {
|
_getEventTiles: function() {
|
||||||
var EventTile = sdk.getComponent('rooms.EventTile');
|
var EventTile = sdk.getComponent('rooms.EventTile');
|
||||||
|
|
||||||
|
|
|
@ -1028,7 +1028,7 @@ module.exports = React.createClass({
|
||||||
// telling it about it. This also ensures that the scroll offset is
|
// telling it about it. This also ensures that the scroll offset is
|
||||||
// updated.
|
// updated.
|
||||||
if (this.refs.messagePanel) {
|
if (this.refs.messagePanel) {
|
||||||
this.refs.messagePanel.forceUpdate();
|
this.refs.messagePanel.onResize();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -467,6 +467,13 @@ var TimelinePanel = React.createClass({
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// makes the TimelinePanel update itself after it is resized (due to other
|
||||||
|
// changes in the DOM)
|
||||||
|
onResize: function() {
|
||||||
|
if (!this.refs.messagePanel) { return; }
|
||||||
|
this.refs.messagePanel.onResize();
|
||||||
|
},
|
||||||
|
|
||||||
_initTimeline: function(props) {
|
_initTimeline: function(props) {
|
||||||
var initialEvent = props.eventId;
|
var initialEvent = props.eventId;
|
||||||
var pixelOffset = props.eventPixelOffset;
|
var pixelOffset = props.eventPixelOffset;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue