mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 12:39:20 +03:00
Don't thumbnail message inline images and show filename in title attribute
This commit is contained in:
parent
13f20cbeb0
commit
f488212c3d
5 changed files with 18 additions and 6 deletions
|
|
@ -308,6 +308,7 @@ export const
|
|||
attachment = findAttachmentByCid(value);
|
||||
if (attachment?.download) {
|
||||
oElement.src = attachment.linkPreview();
|
||||
oElement.title += ' ('+attachment.fileName+')';
|
||||
attachment.isInline(true);
|
||||
attachment.isLinked(true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -133,12 +133,18 @@ export class AttachmentModel extends AbstractModel {
|
|||
return this.url || serverRequestRaw('View', this.download);
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {boolean}
|
||||
*/
|
||||
hasThumbnail() {
|
||||
return this.isThumbnail && !this.isLinked();
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string}
|
||||
*/
|
||||
linkThumbnailPreviewStyle() {
|
||||
// return (this.isThumbnail && !this.isLinked())
|
||||
return this.isThumbnail
|
||||
thumbnailStyle() {
|
||||
return this.hasThumbnail()
|
||||
? 'background:url(' + serverRequestRaw('ViewThumbnail', this.download) + ')'
|
||||
: '';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -318,6 +318,11 @@ html.rl-no-preview-pane {
|
|||
|
||||
.attachmentList {
|
||||
margin: 0;
|
||||
/*
|
||||
min-height: 4em;
|
||||
max-height: 15vh;
|
||||
overflow: auto;
|
||||
*/
|
||||
}
|
||||
|
||||
&:not(.selection-mode) {
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class Attachment implements \JsonSerializable
|
|||
return \str_replace('/', $sIdx.'.', $sMimeType);
|
||||
}
|
||||
|
||||
return ($this->oBodyStructure->IsInline() ? 'part' : 'inline' ) . $sIdx;
|
||||
return ($this->oBodyStructure->IsInline() ? 'inline' : 'part' ) . $sIdx;
|
||||
}
|
||||
|
||||
public function MimeType() : string
|
||||
|
|
|
|||
|
|
@ -236,8 +236,8 @@
|
|||
<i class="hidePreview iconMain" data-bind="css: iconClass()"></i>
|
||||
<div class="showPreview">
|
||||
<a data-bind="css: {'attachmentImagePreview': isImage()}, attr: { 'title': fileName, 'href': linkPreviewMain() }" target="_blank">
|
||||
<i class="iconMain" data-bind="visible: !isThumbnail, css: iconClass()"></i>
|
||||
<div class="iconBG" data-bind="attr: { 'style': linkThumbnailPreviewStyle() }"></div>
|
||||
<i class="iconMain" data-bind="visible: !hasThumbnail(), css: iconClass()"></i>
|
||||
<div class="iconBG" data-bind="attr: { 'style': thumbnailStyle() }"></div>
|
||||
<div class="iconPreview fontastic">👁</div>
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue