From a76b4f972c54b3d72ea3e04a393abb25d05f8c4b Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 11 Mar 2015 11:33:27 +0100 Subject: [PATCH] Fixed ImageViewer not properly loading images in Chrome --- wcfsetup/install/files/js/WCF.ImageViewer.js | 23 +++++--------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/wcfsetup/install/files/js/WCF.ImageViewer.js b/wcfsetup/install/files/js/WCF.ImageViewer.js index 77512206cc..2c485ed73d 100644 --- a/wcfsetup/install/files/js/WCF.ImageViewer.js +++ b/wcfsetup/install/files/js/WCF.ImageViewer.js @@ -720,24 +720,13 @@ $.widget('ui.wcfImageViewer', { } if (this.options.staticViewer && !imageData.image.height && $image[0].complete) { - var $img = new Image(); - $img.src = imageData.image.url; - - // Chrome on iOS seems to not fetch images from cache - if (navigator.userAgent.match(/CriOS/)) { - var self = this; - $img.onload = function() { - imageData.image.height = this.height; - imageData.image.width = this.width; - - self._renderImage(targetIndex, imageData, containerDimensions); - }; - - return; - } + $image.css({ + height: 'auto', + width: 'auto' + }); - imageData.image.height = $img.height; - imageData.image.width = $img.width; + imageData.image.height = $image[0].height; + imageData.image.width = $image[0].width; } var $height = imageData.image.height; -- 2.20.1