diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2018-03-07 12:02:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-07 12:02:05 +0100 |
commit | b170627ceb8838c358aef1fcca9673ce4aa61ab8 (patch) | |
tree | c1a22f974513aaf459e5cb854527f1b71b4440b1 /app | |
parent | a1b065700a9aafd0989bd5686c849f961f727c83 (diff) |
Fix cover behaviour of thumbnails that are wider than taller (#6678)
Diffstat (limited to 'app')
-rw-r--r-- | app/javascript/mastodon/components/media_gallery.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/javascript/mastodon/components/media_gallery.js b/app/javascript/mastodon/components/media_gallery.js index 3568a8440..71436500a 100644 --- a/app/javascript/mastodon/components/media_gallery.js +++ b/app/javascript/mastodon/components/media_gallery.js @@ -167,6 +167,14 @@ class Item extends React.PureComponent { vShift = shiftToPoint(widthRatio, (containerHeight * (height / 100)), originalHeight, focusY, true); } + if (originalWidth > originalHeight) { + imageStyle.height = '100%'; + imageStyle.width = 'auto'; + } else { + imageStyle.height = 'auto'; + imageStyle.width = '100%'; + } + imageStyle.top = vShift; imageStyle.left = hShift; } else { |