Incorrect recognition of legacy attachment widths
authorAlexander Ebert <ebert@woltlab.com>
Fri, 15 May 2020 12:00:53 +0000 (14:00 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 15 May 2020 12:00:53 +0000 (14:00 +0200)
com.woltlab.wcf/templates/wysiwyg.tpl
wcfsetup/install/files/js/WCF.Attachment.js

index 85546348908ce1a3c83b4ccf2f8a72b88fae5fa1..9c4b1046495914b6807a38824ebaeb5419ca1af0 100644 (file)
                                woltlab: {
                                        allowImages: {if $__wcf->getBBCodeHandler()->isAvailableBBCode('img')}true{else}false{/if},
                                        attachments: (elDataBool(element, 'disable-attachments') === false),
+                                       attachmentThumbnailWidth: {@ATTACHMENT_THUMBNAIL_WIDTH},
                                        autosave: autosave,
                                        allowedInlineStyles: allowedInlineStyles,
                                        buttons: buttonOptions,
index 031726505900541598fc4cf2983084d582b88ff5..d170624e2171c61fb039f547063ba8c4cfd168ef 100644 (file)
@@ -131,8 +131,10 @@ WCF.Attachment.Upload = WCF.Upload.extend({
                                var images = this._getImageAttachments();
                                var attachmentId = data.attributes[0] || 0;
                                if (images.hasOwnProperty(attachmentId)) {
+                                       var thumbnailWidth = ~~$('#' + this._editorId).data('redactor').opts.woltlab.attachmentThumbnailWidth;
+                                       
                                        var thumbnail = data.attributes[2];
-                                       thumbnail = (thumbnail === true || thumbnail === 'true' || ~~thumbnail > 0);
+                                       thumbnail = (thumbnail === true || thumbnail === 'true' || ~~thumbnail <= thumbnailWidth);
                                        
                                        var image = elCreate('img');
                                        image.className = 'woltlabAttachment';