[Glitch] Change media elements to use aspect-ratio rather than compute height themselves
Port 598e63dad2
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
@@ -358,12 +358,10 @@ class MediaGallery extends React.PureComponent {
|
||||
|
||||
const computedClass = classNames('media-gallery', { 'full-width': fullwidth });
|
||||
|
||||
if (this.isStandaloneEligible() && width) {
|
||||
style.height = width / this.props.media.getIn([0, 'meta', 'small', 'aspect']);
|
||||
} else if (width) {
|
||||
style.height = width / (16/9);
|
||||
if (this.isStandaloneEligible()) { // TODO: cropImages setting
|
||||
style.aspectRatio = `${this.props.media.getIn([0, 'meta', 'small', 'aspect'])}`;
|
||||
} else {
|
||||
return (<div className={computedClass} ref={this.handleRef} />);
|
||||
style.aspectRatio = '16 / 9';
|
||||
}
|
||||
|
||||
if (this.isStandaloneEligible()) {
|
||||
|
Reference in New Issue
Block a user