ImageViewer could not properly find the thumbnail for attachment tab
authorAlexander Ebert <ebert@woltlab.com>
Thu, 4 Dec 2014 12:54:51 +0000 (13:54 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 4 Dec 2014 12:54:51 +0000 (13:54 +0100)
wcfsetup/install/files/js/WCF.ImageViewer.js

index 040e12f73d2301b57654d5178d765ec2a73d97bf..55d18ebc77ea202bb5d9a4222926ae4a1b0f647d 100644 (file)
@@ -1180,6 +1180,10 @@ $.widget('ui.wcfImageViewer', {
                
                $(this.options.imageSelector).each(function(index, link) {
                        var $link = $(link);
+                       var $thumbnail = $link.children('img');
+                       if (!$thumbnail.length) {
+                               $thumbnail = $link.parentsUntil('.formAttachmentList').last().find('.attachmentTinyThumbnail');
+                       }
                        
                        $images.push({
                                image: {
@@ -1190,7 +1194,7 @@ $.widget('ui.wcfImageViewer', {
                                },
                                series: null,
                                thumbnail: {
-                                       url: $link.children('img').prop('src')
+                                       url: $thumbnail.prop('src')
                                },
                                user: null
                        });