From 5a537ba16810a32db01dba6f7b2ddbc117ce6908 Mon Sep 17 00:00:00 2001 From: rr- Date: Wed, 29 Jul 2015 19:39:10 +0200 Subject: [PATCH] Fixed "original width" fit on Webkit --- .../js/Presenters/PostContentPresenter.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/public_html/js/Presenters/PostContentPresenter.js b/public_html/js/Presenters/PostContentPresenter.js index a74b6dab..cb8974a4 100644 --- a/public_html/js/Presenters/PostContentPresenter.js +++ b/public_html/js/Presenters/PostContentPresenter.js @@ -55,24 +55,26 @@ App.Presenters.PostContentPresenter = function( height = originalHeight; } } - $wrapper.css({maxWidth: width + 'px', width: ''}); + $wrapper.css({maxWidth: width + 'px'}); }, 'fit-height': function(allowUpscale) { var width = containerHeight * ratio; if (width > originalWidth && !allowUpscale) { width = originalWidth; } - $wrapper.css({maxWidth: width + 'px', width: ''}); + $wrapper.css({maxWidth: width + 'px'}); }, 'fit-width': function(allowUpscale) { if (allowUpscale) { - $wrapper.css({maxWidth: containerWidth + 'px', width: ''}); + $wrapper.css({maxWidth: containerWidth + 'px'}); } else { - $wrapper.css({maxWidth: originalWidth + 'px', width: ''}); + $wrapper.css({maxWidth: originalWidth + 'px'}); } }, 'original': function(allowUpscale) { - $wrapper.css({maxWidth: '', width: originalWidth + 'px'}); + $wrapper.css({ + minWidth: originalWidth + 'px', + width: originalWidth + 'px'}); } }; } @@ -83,6 +85,11 @@ App.Presenters.PostContentPresenter = function( function changeFitMode(fitMode) { $wrapper.data('fit-mode', fitMode); + $wrapper.css({ + width: '', height: '', + minWidth: '', minHeight: '', + maxWidth: '', maxHeight: '', + }); getFitters()[fitMode.style](fitMode.upscale); updatePostNotesSize(); }