You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-05 23:10:41 +03:00
restore scroll position when encrypted download attachment iframe is shown
This commit is contained in:
@@ -203,6 +203,17 @@ module.exports = React.createClass({
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
propTypes: {
|
||||||
|
/* the MatrixEvent to show */
|
||||||
|
mxEvent: PropTypes.object.isRequired,
|
||||||
|
/* already decrypted blob */
|
||||||
|
decryptedBlob: PropTypes.object,
|
||||||
|
/* called when the download link iframe is shown */
|
||||||
|
onHeightChanged: PropTypes.func,
|
||||||
|
/* the shape of the tile, used */
|
||||||
|
tileShape: PropTypes.string,
|
||||||
|
},
|
||||||
|
|
||||||
contextTypes: {
|
contextTypes: {
|
||||||
appConfig: PropTypes.object,
|
appConfig: PropTypes.object,
|
||||||
},
|
},
|
||||||
@@ -248,6 +259,12 @@ module.exports = React.createClass({
|
|||||||
this.tint();
|
this.tint();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
componentDidUpdate: function(prevProps, prevState) {
|
||||||
|
if (this.props.onHeightChanged && !prevState.decryptedBlob && this.state.decryptedBlob) {
|
||||||
|
this.props.onHeightChanged();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
componentWillUnmount: function() {
|
componentWillUnmount: function() {
|
||||||
// Remove this from the list of mounted components
|
// Remove this from the list of mounted components
|
||||||
delete mounts[this.id];
|
delete mounts[this.id];
|
||||||
|
|||||||
Reference in New Issue
Block a user