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