mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-28 11:39:21 +03:00
Resolve #1361
This commit is contained in:
parent
1d652e0ce3
commit
dd46434895
5 changed files with 38 additions and 28 deletions
|
|
@ -10,14 +10,24 @@ export class AttachmentCollectionModel extends AbstractCollectionModel
|
|||
* @returns {AttachmentCollectionModel}
|
||||
*/
|
||||
static reviveFromJson(items) {
|
||||
return super.reviveFromJson(items, attachment => AttachmentModel.reviveFromJson(attachment));
|
||||
/*
|
||||
const attachments = super.reviveFromJson(items, attachment => AttachmentModel.reviveFromJson(attachment));
|
||||
let collator = new Intl.Collator(undefined, {numeric: true, sensitivity: 'base'});
|
||||
attachments.sort((a, b) => {
|
||||
if (a.isInline()) {
|
||||
if (!b.isInline()) {
|
||||
return 1;
|
||||
}
|
||||
} else if (!b.isInline()) {
|
||||
return -1;
|
||||
}
|
||||
return collator.compare(a.fileName, b.fileName);
|
||||
});
|
||||
/*
|
||||
if (attachments) {
|
||||
attachments.InlineCount = attachments.reduce((accumulator, a) => accumulator + (a.isInline ? 1 : 0), 0);
|
||||
}
|
||||
return attachments;
|
||||
*/
|
||||
return attachments;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
.attachmentList {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.attachmentItem {
|
||||
|
||||
background-color: rgba(128, 128, 128, 0.1);
|
||||
|
|
@ -9,8 +13,7 @@
|
|||
line-height: 20px;
|
||||
margin: 5px;
|
||||
min-height: 48px;
|
||||
max-width: 200px;
|
||||
min-width: 60px;
|
||||
width: 16em;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
|
||||
|
|
|
|||
|
|
@ -286,15 +286,6 @@
|
|||
border-bottom: 1px solid var(--border-color, #bbb);
|
||||
position: relative;
|
||||
|
||||
.attachmentList {
|
||||
margin: 0;
|
||||
/*
|
||||
min-height: 4em;
|
||||
max-height: 15vh;
|
||||
overflow: auto;
|
||||
*/
|
||||
}
|
||||
|
||||
&:not(.selection-mode) {
|
||||
.checkboxAttachment {
|
||||
display: none;
|
||||
|
|
|
|||
|
|
@ -162,7 +162,13 @@ export class MailMessageView extends AbstractViewRight {
|
|||
|
||||
listAttachments: () => currentMessage()?.attachments()
|
||||
.filter(item => SettingsUserStore.listInlineAttachments() || !item.isLinked()),
|
||||
hasAttachments: () => this.listAttachments()?.length,
|
||||
// hasAttachments: () => this.listAttachments()?.length,
|
||||
hasAttachments: () => currentMessage()?.attachments()
|
||||
.some(item => SettingsUserStore.listInlineAttachments() || !item.isLinked()),
|
||||
// listInlines: () => currentMessage()?.attachments()
|
||||
// .filter(item => item.isLinked()),
|
||||
// hasInlines: () => currentMessage()?.attachments()
|
||||
// .some(item => SettingsUserStore.listInlineAttachments() || !item.isLinked()),
|
||||
|
||||
canBeRepliedOrForwarded: () => !MessagelistUserStore.isDraftFolder() && this.messageVisible(),
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue