From b75df289e912f4daefb71c3d1cecb3744a0d76db Mon Sep 17 00:00:00 2001 From: rr- Date: Sun, 19 Jul 2015 18:05:16 +0200 Subject: [PATCH] Fixed "fit to height" upscaling small posts --- public_html/js/Presenters/PostContentPresenter.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/public_html/js/Presenters/PostContentPresenter.js b/public_html/js/Presenters/PostContentPresenter.js index 9ddd7966..4cb93778 100644 --- a/public_html/js/Presenters/PostContentPresenter.js +++ b/public_html/js/Presenters/PostContentPresenter.js @@ -36,6 +36,9 @@ App.Presenters.PostContentPresenter = function( var ratio = originalWidth / originalHeight; var height = jQuery(window).height() - $wrapper.offset().top; var width = (height - 10) * ratio; + if (width > originalWidth) { + width = originalWidth; + } $wrapper.css({maxWidth: width + 'px', width: ''}); }, 'fit-width': function($wrapper) {