mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-04 05:52:44 +08:00
Changes for #815
This commit is contained in:
parent
8bd466a656
commit
becdf29120
3 changed files with 16 additions and 8 deletions
|
@ -31,6 +31,7 @@ html.rl-no-preview-pane {
|
|||
|
||||
.groupLabel {
|
||||
background:rgba(128,128,128,0.2);
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
line-height: 2;
|
||||
opacity: 0.6;
|
||||
|
|
|
@ -164,6 +164,7 @@ export class MailMessageList extends AbstractViewRight {
|
|||
current = {
|
||||
id: email,
|
||||
label: msg.from[0].toLine(),
|
||||
search: 'from=' + msg.from[0].email,
|
||||
messages: []
|
||||
};
|
||||
list.push(current);
|
||||
|
@ -175,23 +176,25 @@ export class MailMessageList extends AbstractViewRight {
|
|||
rtf = Intl.RelativeTimeFormat
|
||||
? new Intl.RelativeTimeFormat(doc.documentElement.lang, { numeric: "auto" }) : 0;
|
||||
MessagelistUserStore.forEach(msg => {
|
||||
let date = (new Date(msg.dateTimeStampInUTC() * 1000)),
|
||||
ymd = Ymd(date);
|
||||
let dt = (new Date(msg.dateTimeStampInUTC() * 1000)),
|
||||
date,
|
||||
ymd = Ymd(dt);
|
||||
if (!current || ymd != current.id) {
|
||||
if (rtf && today == ymd) {
|
||||
date = rtf.format(0, 'day');
|
||||
} else if (rtf && today - 1 == ymd) {
|
||||
date = rtf.format(-1, 'day');
|
||||
// } else if (today - 7 < ymd) {
|
||||
// date = date.format({weekday: 'long'});
|
||||
// date = date.format({dateStyle: 'full'},0,LanguageStore.hourCycle());
|
||||
// date = dt.format({weekday: 'long'});
|
||||
// date = dt.format({dateStyle: 'full'},0,LanguageStore.hourCycle());
|
||||
} else {
|
||||
// date = date.format({dateStyle: 'medium'},0,LanguageStore.hourCycle());
|
||||
date = date.format({dateStyle: 'full'},0,LanguageStore.hourCycle());
|
||||
// date = dt.format({dateStyle: 'medium'},0,LanguageStore.hourCycle());
|
||||
date = dt.format({dateStyle: 'full'},0,LanguageStore.hourCycle());
|
||||
}
|
||||
current = {
|
||||
id: ymd,
|
||||
label: date,
|
||||
search: 'on=' + dt.getFullYear() + '-' + pad2(1 + dt.getMonth()) + '-' + pad2(dt.getDate()),
|
||||
messages: []
|
||||
};
|
||||
list.push(current);
|
||||
|
@ -815,6 +818,10 @@ export class MailMessageList extends AbstractViewRight {
|
|||
showScreenPopup(AdvancedSearchPopupView, [MessagelistUserStore.mainSearch()]);
|
||||
}
|
||||
|
||||
groupSearchClick(group) {
|
||||
group.search && MessagelistUserStore.mainSearch(group.search);
|
||||
}
|
||||
|
||||
quotaTooltip() {
|
||||
return i18n('MESSAGE_LIST/QUOTA_SIZE', {
|
||||
SIZE: FileInfo.friendlySize(FolderUserStore.quotaUsage()),
|
||||
|
|
|
@ -130,8 +130,8 @@
|
|||
</div>
|
||||
|
||||
<!-- ko if: listGrouped -->
|
||||
<div class="messageListPlace" data-bind="dragmessages: 1, foreach: groupedList" draggable="true">
|
||||
<div class="groupLabel" data-bind="text: label"></div>
|
||||
<div class="messageListPlace" data-bind="dragmessages: 1, i18nUpdate: groupedList, foreach: groupedList" draggable="true">
|
||||
<div class="groupLabel" data-bind="text: label, click: $root.groupSearchClick" data-i18n="[title]GLOBAL/SEARCH"></div>
|
||||
<!-- ko foreach: messages -->
|
||||
<div class="messageListItem" data-bind="css: lineAsCss()">
|
||||
<div class="messageCheckbox">
|
||||
|
|
Loading…
Reference in a new issue