From 510cccdde234d0f6042240e264c2a5e80e8afb87 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Mon, 16 Feb 2015 16:52:31 +0100 Subject: [PATCH] Fixed image scaling in message preview --- wcfsetup/install/files/js/WCF.ImageViewer.js | 2 +- wcfsetup/install/files/js/WCF.Message.js | 2 +- wcfsetup/install/files/style/message.less | 10 ++++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/js/WCF.ImageViewer.js b/wcfsetup/install/files/js/WCF.ImageViewer.js index 1e70006f07..0fab5801bf 100644 --- a/wcfsetup/install/files/js/WCF.ImageViewer.js +++ b/wcfsetup/install/files/js/WCF.ImageViewer.js @@ -92,7 +92,7 @@ WCF.ImageViewer = Class.extend({ var $imageObject = new Image(); $imageObject.src = $image.attr('src'); - var $maxWidth = $image.closest('div.messageText').width(); + var $maxWidth = $image.closest('div.messageText, div.messageTextPreview').width(); if ($maxWidth < $imageObject.width) { if (!$image.parents('a').length) { $image.wrap(''); diff --git a/wcfsetup/install/files/js/WCF.Message.js b/wcfsetup/install/files/js/WCF.Message.js index 29aaaa699a..bbfb755a8f 100644 --- a/wcfsetup/install/files/js/WCF.Message.js +++ b/wcfsetup/install/files/js/WCF.Message.js @@ -477,7 +477,7 @@ WCF.Message.DefaultPreview = WCF.Message.Preview.extend({ _handleResponse: function(data) { var $preview = $('#previewContainer'); if (!$preview.length) { - $preview = $('
' + WCF.Language.get('wcf.global.preview') + '
').prependTo($('#messageContainer')).wcfFadeIn(); + $preview = $('
' + WCF.Language.get('wcf.global.preview') + '
').prependTo($('#messageContainer')).wcfFadeIn(); } $preview.find('div:eq(0)').html(data.returnValues.message); diff --git a/wcfsetup/install/files/style/message.less b/wcfsetup/install/files/style/message.less index 6c3f33d505..99cc2c47b7 100644 --- a/wcfsetup/install/files/style/message.less +++ b/wcfsetup/install/files/style/message.less @@ -511,6 +511,16 @@ } } +.messageTextPreview { + img { + max-width: 100%; + } + + table img { + max-width: none; + } +} + @messageFooterNoteGradientColor: fade(@wcfContainerBorderColor, 20%); @messageFooterNoteGradientColor2: fade(@messageFooterNoteGradientColor, 0%); .messageFooterNote { -- 2.20.1