|
|
@ -238,7 +238,7 @@ export default class MediaGallery extends React.PureComponent { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
handleRef = (node) => { |
|
|
|
handleRef = (node) => { |
|
|
|
if (node /*&& this.isStandaloneEligible()*/) { |
|
|
|
if (node && this.isStandaloneEligible()) { |
|
|
|
// offsetWidth triggers a layout, so only calculate when we need to
|
|
|
|
// offsetWidth triggers a layout, so only calculate when we need to
|
|
|
|
this.setState({ |
|
|
|
this.setState({ |
|
|
|
width: node.offsetWidth, |
|
|
|
width: node.offsetWidth, |
|
|
@ -260,12 +260,8 @@ export default class MediaGallery extends React.PureComponent { |
|
|
|
|
|
|
|
|
|
|
|
const style = {}; |
|
|
|
const style = {}; |
|
|
|
|
|
|
|
|
|
|
|
if (this.isStandaloneEligible()) { |
|
|
|
if (this.isStandaloneEligible() && width) { |
|
|
|
if (width) { |
|
|
|
style.height = width / this.props.media.getIn([0, 'meta', 'small', 'aspect']); |
|
|
|
style.height = width / this.props.media.getIn([0, 'meta', 'small', 'aspect']); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else if (width) { |
|
|
|
|
|
|
|
style.height = width / (16/9); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!visible) { |
|
|
|
if (!visible) { |
|
|
|