diff --git a/dev/Model/Attachment.js b/dev/Model/Attachment.js index 16271e4a9..d7e8ae2f3 100644 --- a/dev/Model/Attachment.js +++ b/dev/Model/Attachment.js @@ -20,7 +20,6 @@ export class AttachmentModel extends AbstractModel { this.fileName = ''; this.fileNameExt = ''; this.fileType = FileType.Unknown; - this.friendlySize = ''; this.isThumbnail = false; this.cid = ''; this.contentLocation = ''; @@ -29,6 +28,7 @@ export class AttachmentModel extends AbstractModel { this.uid = ''; this.url = ''; this.mimeIndex = ''; + this.estimatedSize = 0; this.framed = false; this.addObservables({ @@ -45,14 +45,16 @@ export class AttachmentModel extends AbstractModel { static reviveFromJson(json) { const attachment = super.reviveFromJson(json); if (attachment) { - attachment.friendlySize = FileInfo.friendlySize(json.EstimatedSize); - attachment.fileNameExt = FileInfo.getExtension(attachment.fileName); attachment.fileType = FileInfo.getType(attachment.fileNameExt, attachment.mimeType); } return attachment; } + friendlySize() { + return FileInfo.friendlySize(this.estimatedSize) + (this.isLinked() ? ' 🔗' : ''); + } + contentId() { return this.cid.replace(/^<+|>+$/g, ''); } @@ -85,13 +87,6 @@ export class AttachmentModel extends AbstractModel { return FileType.Audio === this.fileType && 'wav' === this.fileNameExt; } - /** - * @returns {boolean} - */ - hasThumbnail() { - return this.isThumbnail; - } - /** * @returns {boolean} */ @@ -142,7 +137,10 @@ export class AttachmentModel extends AbstractModel { * @returns {string} */ linkThumbnailPreviewStyle() { - return this.hasThumbnail() ? 'background:url(' + serverRequestRaw('ViewThumbnail', this.download) + ')' : ''; +// return (this.isThumbnail && !this.isLinked()) + return this.isThumbnail + ? 'background:url(' + serverRequestRaw('ViewThumbnail', this.download) + ')' + : ''; } /** diff --git a/dev/Styles/User/Attachments.less b/dev/Styles/User/Attachments.less index 3451a57dc..99be8beac 100644 --- a/dev/Styles/User/Attachments.less +++ b/dev/Styles/User/Attachments.less @@ -6,9 +6,9 @@ box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04), 0 1px 5px rgba(0, 0, 0, 0.1); display: inline-block; list-style: none; - line-height: 24px; + line-height: 20px; margin: 5px; - min-height: 50px; + min-height: 48px; max-width: 200px; min-width: 60px; overflow: hidden; @@ -33,8 +33,8 @@ .attachmentIconParent { position: absolute; - height: 56px; - width: 60px; + height: 48px; + width: 48px; text-align: center; } @@ -65,7 +65,7 @@ .attachmentNameParent { border-left: 1px solid #ddd; cursor: pointer; - margin-left: 60px; + margin-left: 48px; min-width: 90px; padding: 4px 4px 3px 6px; position: relative; diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Raw.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Raw.php index 8dd73136b..ec0f1a3cf 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Raw.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Raw.php @@ -212,7 +212,7 @@ trait Raw { if ($bThumbnail) { - $oImage = static::loadImage($rResource, $bDetectImageOrientation, 60); + $oImage = static::loadImage($rResource, $bDetectImageOrientation, 48); \header('Content-Disposition: inline; '. \trim(\MailSo\Base\Utils::EncodeHeaderUtf8AttributeValue('filename', $sFileName.'_thumb60x60.png'))); $oImage->show('png'); diff --git a/snappymail/v/0.0.0/app/templates/Views/User/MailMessageView.html b/snappymail/v/0.0.0/app/templates/Views/User/MailMessageView.html index 47576b7a1..0cd68bdb4 100644 --- a/snappymail/v/0.0.0/app/templates/Views/User/MailMessageView.html +++ b/snappymail/v/0.0.0/app/templates/Views/User/MailMessageView.html @@ -231,7 +231,7 @@
- +
👁
@@ -243,7 +243,7 @@
-
+