mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Also show inline images as attachments
This commit is contained in:
parent
7f63a1e82d
commit
da451ed369
4 changed files with 5 additions and 11 deletions
|
|
@ -20,13 +20,6 @@ export class AttachmentCollectionModel extends AbstractCollectionModel
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @returns {boolean}
|
|
||||||
*/
|
|
||||||
hasVisible() {
|
|
||||||
return !!this.filter(item => !item.isLinked()).length;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} cid
|
* @param {string} cid
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,8 @@ export class MessageModel extends AbstractModel {
|
||||||
this.addComputables({
|
this.addComputables({
|
||||||
attachmentIconClass: () => FileInfo.getAttachmentsIconClass(this.attachments()),
|
attachmentIconClass: () => FileInfo.getAttachmentsIconClass(this.attachments()),
|
||||||
threadsLen: () => this.threads().length,
|
threadsLen: () => this.threads().length,
|
||||||
hasAttachments: () => this.attachments().hasVisible(),
|
// hasAttachments: () => this.attachments().filter(item => !item.isLinked()).length,
|
||||||
|
hasAttachments: () => this.attachments().length,
|
||||||
|
|
||||||
isUnseen: () => !this.flags().includes('\\seen'),
|
isUnseen: () => !this.flags().includes('\\seen'),
|
||||||
isFlagged: () => this.flags().includes('\\flagged'),
|
isFlagged: () => this.flags().includes('\\flagged'),
|
||||||
|
|
|
||||||
|
|
@ -137,7 +137,7 @@ export class MailMessageView extends AbstractViewRight {
|
||||||
|
|
||||||
downloadAsZipAllowed: () => this.attachmentsActions.includes('zip')
|
downloadAsZipAllowed: () => this.attachmentsActions.includes('zip')
|
||||||
&& (currentMessage()?.attachments || [])
|
&& (currentMessage()?.attachments || [])
|
||||||
.filter(item => item?.download && !item?.isLinked() && item?.checked())
|
.filter(item => item?.download /*&& !item?.isLinked()*/ && item?.checked())
|
||||||
.length,
|
.length,
|
||||||
|
|
||||||
tagsAllowed: () => FolderUserStore.currentFolder() ? FolderUserStore.currentFolder().tagsAllowed() : false,
|
tagsAllowed: () => FolderUserStore.currentFolder() ? FolderUserStore.currentFolder().tagsAllowed() : false,
|
||||||
|
|
@ -467,7 +467,7 @@ export class MailMessageView extends AbstractViewRight {
|
||||||
|
|
||||||
downloadAsZip() {
|
downloadAsZip() {
|
||||||
const hashes = (currentMessage() ? currentMessage().attachments : [])
|
const hashes = (currentMessage() ? currentMessage().attachments : [])
|
||||||
.map(item => item?.checked() && !item?.isLinked() ? item.download : '')
|
.map(item => item?.checked() /*&& !item?.isLinked()*/ ? item.download : '')
|
||||||
.filter(v => v);
|
.filter(v => v);
|
||||||
if (hashes.length) {
|
if (hashes.length) {
|
||||||
Remote.post('AttachmentsActions', this.downloadAsZipLoading, {
|
Remote.post('AttachmentsActions', this.downloadAsZipLoading, {
|
||||||
|
|
|
||||||
|
|
@ -226,7 +226,7 @@
|
||||||
<div class="attachmentsPlace" data-bind="visible: message().hasAttachments(), css: {'selection-mode' : showAttachmentControls}">
|
<div class="attachmentsPlace" data-bind="visible: message().hasAttachments(), css: {'selection-mode' : showAttachmentControls}">
|
||||||
<ul class="attachmentList" data-bind="foreach: message().attachments()">
|
<ul class="attachmentList" data-bind="foreach: message().attachments()">
|
||||||
<li class="attachmentItem" draggable="true"
|
<li class="attachmentItem" draggable="true"
|
||||||
data-bind="visible: !isLinked(), event: { 'dragstart': eventDragStart }, attr: { 'title': fileName }, css: {'checked': checked}">
|
data-bind="event: { 'dragstart': eventDragStart }, attr: { 'title': fileName }, css: {'checked': checked}">
|
||||||
<div class="attachmentIconParent" data-bind="css: { 'hasPreview': hasPreview(), 'hasPreplay': hasPreplay(), 'isImage': isImage() }">
|
<div class="attachmentIconParent" data-bind="css: { 'hasPreview': hasPreview(), 'hasPreplay': hasPreplay(), 'isImage': isImage() }">
|
||||||
<i class="hidePreview iconMain" data-bind="css: iconClass()"></i>
|
<i class="hidePreview iconMain" data-bind="css: iconClass()"></i>
|
||||||
<div class="showPreview">
|
<div class="showPreview">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue