Prevent images in signatures being recognized by the ImageViewer
authorAlexander Ebert <ebert@woltlab.com>
Sun, 11 Jan 2015 19:06:34 +0000 (20:06 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 11 Jan 2015 19:06:34 +0000 (20:06 +0100)
wcfsetup/install/files/js/WCF.ImageViewer.js

index d7fef73c7e303c51035a2e5519d17231f7576bb5..12771663348831432ec20a5da3099f9aab5813d6 100644 (file)
@@ -83,6 +83,11 @@ WCF.ImageViewer = Class.extend({
                
                $image.removeClass('jsResizeImage');
                
+               // check if image falls within the signature, in that case ignore it
+               if ($image.closest('.messageSignature').length) {
+                       return;
+               }
+               
                // setting img { max-width: 100% } causes the image to fit within boundaries, but does not reveal the original dimenions
                var $imageObject = new Image();
                $imageObject.src = $image.attr('src');