show images with unknown height - fixes issue 475 hopefully

This commit is contained in:
Matthew Hodgson 2015-12-09 13:24:15 +00:00
parent 4b8d7a612a
commit 8ecf70dda0

View File

@ -105,6 +105,11 @@ module.exports = React.createClass({
res = ", " + style.width + "x" + style.height + "px"; res = ", " + style.width + "x" + style.height + "px";
} }
var size;
if (this.props.mxEvent.getContent().info && this.props.mxEvent.getContent().info.size) {
size = filesize(this.props.mxEvent.getContent().info.size);
}
return ( return (
<div className="mx_ImageView"> <div className="mx_ImageView">
<div className="mx_ImageView_lhs"> <div className="mx_ImageView_lhs">
@ -124,7 +129,7 @@ module.exports = React.createClass({
<a className="mx_ImageView_link" href={ this.props.src } target="_blank"> <a className="mx_ImageView_link" href={ this.props.src } target="_blank">
<div className="mx_ImageView_download"> <div className="mx_ImageView_download">
Download this file<br/> Download this file<br/>
<span className="mx_ImageView_size">({ filesize(this.props.mxEvent.getContent().info.size) }{ res })</span> <span className="mx_ImageView_size">{ size } { res }</span>
</div> </div>
</a> </a>
<div className="mx_ImageView_button"> <div className="mx_ImageView_button">