mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-06 07:57:02 +03:00
Simplify generating folderListVisible
This commit is contained in:
parent
bb906e61ab
commit
5225b62a0a
3 changed files with 3 additions and 39 deletions
|
|
@ -185,27 +185,6 @@
|
||||||
li li li li li a {
|
li li li li li a {
|
||||||
text-indent: 4em;
|
text-indent: 4em;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**/
|
|
||||||
&.single-root-inbox .b-folders-user > li > a {
|
|
||||||
display: none !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.single-root-inbox {
|
|
||||||
li li a {
|
|
||||||
text-indent: 0;
|
|
||||||
}
|
|
||||||
li li li a {
|
|
||||||
text-indent: 1em;
|
|
||||||
}
|
|
||||||
li li li li a {
|
|
||||||
text-indent: 2em;
|
|
||||||
}
|
|
||||||
li li li li li a {
|
|
||||||
text-indent: 3em;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#rl-left .buttonCompose {
|
#rl-left .buttonCompose {
|
||||||
|
|
|
||||||
|
|
@ -35,8 +35,6 @@ export class MailFolderList extends AbstractViewLeft {
|
||||||
|
|
||||||
this.moveAction = moveAction;
|
this.moveAction = moveAction;
|
||||||
|
|
||||||
this.foldersListWithSingleInboxRootFolder = ko.observable(false);
|
|
||||||
|
|
||||||
this.allowContacts = AppUserStore.allowContacts();
|
this.allowContacts = AppUserStore.allowContacts();
|
||||||
|
|
||||||
this.foldersFilter = foldersFilter;
|
this.foldersFilter = foldersFilter;
|
||||||
|
|
@ -45,23 +43,10 @@ export class MailFolderList extends AbstractViewLeft {
|
||||||
foldersFilterVisible: () => 20 < FolderUserStore.folderList().CountRec,
|
foldersFilterVisible: () => 20 < FolderUserStore.folderList().CountRec,
|
||||||
|
|
||||||
folderListVisible: () => {
|
folderListVisible: () => {
|
||||||
let multiple = false,
|
let result = FolderUserStore.folderList().filter(folder => folder.visible());
|
||||||
inbox, visible,
|
|
||||||
result = FolderUserStore.folderList().filter(folder => {
|
|
||||||
if (folder.isInbox()) {
|
|
||||||
inbox = folder;
|
|
||||||
}
|
|
||||||
visible = folder.visible();
|
|
||||||
multiple |= visible && !folder.isInbox();
|
|
||||||
return visible;
|
|
||||||
});
|
|
||||||
if (inbox && !multiple) {
|
|
||||||
inbox.collapsed(false);
|
|
||||||
}
|
|
||||||
this.foldersListWithSingleInboxRootFolder(!multiple);
|
|
||||||
// https://github.com/the-djmaze/snappymail/issues/1427
|
// https://github.com/the-djmaze/snappymail/issues/1427
|
||||||
// result.sort((a, b) => a.unreadEmails ? (b.unreadEmails ? 0 : -1) : (b.unreadEmails ? 1 : 0));
|
// result.sort((a, b) => a.unreadEmails ? (b.unreadEmails ? 0 : -1) : (b.unreadEmails ? 1 : 0));
|
||||||
return result;
|
return 1 === result.length && result[0].isInbox() ? result[0].subFolders() : result;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<div class="b-folders g-ui-user-select-none" data-bind="css: {'single-root-inbox': foldersListWithSingleInboxRootFolder}">
|
<div class="b-folders g-ui-user-select-none">
|
||||||
<div class="b-toolbar btn-toolbar">
|
<div class="b-toolbar btn-toolbar">
|
||||||
<a class="btn buttonCompose" data-bind="click: composeClick, css: {'btn-warning': composeInEdit, 'btn-success': !composeInEdit()}" data-i18n="[title]FOLDER_LIST/BUTTON_NEW_MESSAGE">
|
<a class="btn buttonCompose" data-bind="click: composeClick, css: {'btn-warning': composeInEdit, 'btn-success': !composeInEdit()}" data-i18n="[title]FOLDER_LIST/BUTTON_NEW_MESSAGE">
|
||||||
<i class="icon-paper-plane"></i>
|
<i class="icon-paper-plane"></i>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue