Finally drop the FolderModel.hidden() because FolderModel.visible() works better

This commit is contained in:
the-djmaze 2022-10-07 13:04:51 +02:00
parent f56102dd88
commit a219509bd7
4 changed files with 4 additions and 10 deletions

View file

@ -393,8 +393,6 @@ export class FolderModel extends AbstractModel {
return folder.hasVisibleSubfolders() | visible;
},
hidden: () => !folder.selectable() && (folder.isSystemFolder() | !folder.hasVisibleSubfolders()),
printableUnreadCount: () => {
const count = folder.totalEmails(),
unread = folder.unreadEmails(),

View file

@ -123,10 +123,6 @@
font-weight: bold;
}
&.hidden {
display: none;
}
.e-collapsed-sign {
cursor: pointer;
font-size: 150%;

View file

@ -124,7 +124,7 @@ export class MailFolderList extends AbstractViewLeft {
addShortcut('arrowup,arrowdown', '', Scope.FolderList, event => {
let items = [], index = 0;
dom.querySelectorAll('li a:not(.hidden)').forEach(node => {
dom.querySelectorAll('li a').forEach(node => {
if (node.offsetHeight || node.getClientRects().length) {
items.push(node);
if (node.matches('.focused')) {
@ -147,7 +147,7 @@ export class MailFolderList extends AbstractViewLeft {
});
addShortcut('enter,open', '', Scope.FolderList, () => {
const item = qs('li a:not(.hidden).focused');
const item = qs('li a.focused');
if (item) {
AppUserStore.focusedState(Scope.MessageList);
item.click();
@ -157,7 +157,7 @@ export class MailFolderList extends AbstractViewLeft {
});
addShortcut('space', '', Scope.FolderList, () => {
const item = qs('li a:not(.hidden).focused'),
const item = qs('li a.focused'),
folder = item && ko.dataFor(item);
if (folder) {
const collapsed = folder.collapsed();

View file

@ -1,7 +1,7 @@
<!-- ko if: visible -->
<li>
<a data-bind="dropmessages: $data,
css: { 'selected': selected() && !isSystemFolder(), 'system': isSystemFolder, 'selectable': canBeSelected, 'hidden' : hidden, 'unread-sub': hasSubscribedUnreadMessagesSubfolders, 'anim-action-class': actionBlink },
css: { 'selected': selected() && !isSystemFolder(), 'system': isSystemFolder, 'selectable': canBeSelected, 'unread-sub': hasSubscribedUnreadMessagesSubfolders, 'anim-action-class': actionBlink },
attr: { 'data-unread': printableUnreadCount }">
<i data-bind="css: collapsedCss()"></i>
<!-- ko text: name --><!-- /ko -->