logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe
commit: b170627ceb8838c358aef1fcca9673ce4aa61ab8
parent: a1b065700a9aafd0989bd5686c849f961f727c83
Author: Eugen Rochko <eugen@zeonfederated.com>
Date:   Wed,  7 Mar 2018 12:02:05 +0100

Fix cover behaviour of thumbnails that are wider than taller (#6678)


Diffstat:

Mapp/javascript/mastodon/components/media_gallery.js8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git 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 {