mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-01 10:27:06 +03:00
Only include placeholder in DOM when necessary
This commit is contained in:
parent
e9ae3de00f
commit
e4f8c09c32
1 changed files with 9 additions and 8 deletions
|
@ -276,15 +276,16 @@ export default class extends React.Component {
|
|||
{ /* Calculate aspect ratio, using %padding will size _container correctly */ }
|
||||
<div style={{ paddingBottom: (100 * content.info.h / content.info.w) + '%' }}></div>
|
||||
|
||||
<div className="mx_MImageBody_thumbnail" style={{
|
||||
"display": showPlaceholder ? undefined : 'none',
|
||||
// Constrain width here so that spinner appears central to the loaded thumbnail
|
||||
"max-width": content.info.w + "px",
|
||||
}}>
|
||||
<div className="mx_MImageBody_thumbnail_spinner">
|
||||
{ placeholder }
|
||||
{ showPlaceholder &&
|
||||
<div className="mx_MImageBody_thumbnail" style={{
|
||||
// Constrain width here so that spinner appears central to the loaded thumbnail
|
||||
"max-width": content.info.w + "px",
|
||||
}}>
|
||||
<div className="mx_MImageBody_thumbnail_spinner">
|
||||
{ placeholder }
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div style={{display: !showPlaceholder ? undefined : 'none'}}>
|
||||
{ img }
|
||||
|
|
Loading…
Reference in a new issue