webmail: make double click on mailbox expand/collapse, and make mailbox text unselectable (so the double click doesn't also select text)

This commit is contained in:
Mechiel Lukkien 2023-09-21 11:40:22 +02:00
parent 941a2311f0
commit 9bc860e207
No known key found for this signature in database
3 changed files with 21 additions and 1 deletions

View file

@ -49,7 +49,7 @@ table.search td { padding: .25em; }
.keyword { background-color: gold; color: black; border: 1px solid #8c7600; padding: 0 .15em; border-radius: .15em; font-weight: normal; font-size: .9em; margin: 0 .15em; white-space: nowrap; }
.keyword.keywordcollapsed { background-color: #ffeb7e; color: #333; }
.mailbox { padding: .15em .25em; }
.mailboxitem { cursor: pointer; border-radius: .15em; }
.mailboxitem { cursor: pointer; border-radius: .15em; user-select: none; }
.mailboxitem.dropping { background: gold !important; }
.mailboxitem:hover { background: #eee; }
.mailboxitem.active { background: linear-gradient(135deg, #ffc7ab 0%, #ffdeab 100%); }

View file

@ -4300,6 +4300,16 @@ const newMailboxView = (xmb, mailboxlistView, otherMailbox) => {
else if (e.key === 'b') {
cmdOpenActions();
}
}, async function dblclick() {
if (mailboxlistView.mailboxLeaf(mbv)) {
return;
}
if (settings.mailboxCollapsed[mbv.mailbox.ID]) {
cmdExpand();
}
else {
cmdCollapse();
}
}, async function click() {
mbv.root.focus();
await withStatus('Opening mailbox', mbv.open(true));

View file

@ -4157,6 +4157,16 @@ const newMailboxView = (xmb: api.Mailbox, mailboxlistView: MailboxlistView, othe
cmdOpenActions()
}
},
async function dblclick() {
if (mailboxlistView.mailboxLeaf(mbv)) {
return
}
if (settings.mailboxCollapsed[mbv.mailbox.ID]) {
cmdExpand()
} else {
cmdCollapse()
}
},
async function click() {
mbv.root.focus()
await withStatus('Opening mailbox', mbv.open(true))