Merge pull request #577 from matrix-org/luke/fix-scroll-jump-on-image-decryption
Fix scroll jump on image decryption
This commit is contained in:
commit
0a42a78b13
1 changed files with 8 additions and 3 deletions
|
@ -32,6 +32,9 @@ module.exports = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
/* the MatrixEvent to show */
|
/* the MatrixEvent to show */
|
||||||
mxEvent: React.PropTypes.object.isRequired,
|
mxEvent: React.PropTypes.object.isRequired,
|
||||||
|
|
||||||
|
/* called when the image has loaded */
|
||||||
|
onWidgetLoad: React.PropTypes.func.isRequired,
|
||||||
},
|
},
|
||||||
|
|
||||||
getInitialState: function() {
|
getInitialState: function() {
|
||||||
|
@ -123,6 +126,7 @@ module.exports = React.createClass({
|
||||||
decryptedUrl: contentUrl,
|
decryptedUrl: contentUrl,
|
||||||
decryptedThumbnailUrl: thumbnailUrl,
|
decryptedThumbnailUrl: thumbnailUrl,
|
||||||
});
|
});
|
||||||
|
this.props.onWidgetLoad();
|
||||||
});
|
});
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
console.warn("Unable to decrypt attachment: ", err);
|
console.warn("Unable to decrypt attachment: ", err);
|
||||||
|
@ -186,11 +190,12 @@ module.exports = React.createClass({
|
||||||
<span className="mx_MImageBody" ref="body">
|
<span className="mx_MImageBody" ref="body">
|
||||||
<div className="mx_MImageBody_thumbnail" ref="image" style={{
|
<div className="mx_MImageBody_thumbnail" ref="image" style={{
|
||||||
"display": "flex",
|
"display": "flex",
|
||||||
"align-items": "center",
|
"alignItems": "center",
|
||||||
"justify-items": "center",
|
|
||||||
"width": "100%",
|
"width": "100%",
|
||||||
}}>
|
}}>
|
||||||
<img src="img/spinner.gif" alt={content.body} width="16" height="16"/>
|
<img src="img/spinner.gif" alt={content.body} width="32" height="32" style={{
|
||||||
|
"margin": "auto",
|
||||||
|
}}/>
|
||||||
</div>
|
</div>
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue