mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 13:44:37 +03:00
webmail: add button to create a mailbox below another one
before this, you could use the button at the top of the list of mailboxes to create a submailbox somewhere, and you would have to specify the full path of the new mailbox name. now you can just open up your Lists/.../ mailbox, and create a mailbox below that hierarchy.
This commit is contained in:
@ -5156,6 +5156,32 @@ const newMailboxView = (xmb: api.Mailbox, mailboxlistView: MailboxlistView, othe
|
||||
await withStatus('Marking mailboxes as read', client.MailboxesMarkRead(mailboxIDs))
|
||||
}),
|
||||
),
|
||||
dom.div(
|
||||
dom.clickbutton('Create mailbox', attr.title('Create new mailbox within this mailbox.'), function click(e: MouseEvent) {
|
||||
let fieldset: HTMLFieldSetElement
|
||||
let name: HTMLInputElement
|
||||
const ref = e.target! as HTMLElement
|
||||
const removeCreate = popover(ref, {},
|
||||
dom.form(
|
||||
async function submit(e: SubmitEvent) {
|
||||
e.preventDefault()
|
||||
await withStatus('Creating mailbox', client.MailboxCreate(mbv.mailbox.Name + '/' + name.value), fieldset)
|
||||
removeCreate()
|
||||
},
|
||||
fieldset=dom.fieldset(
|
||||
dom.label(
|
||||
'Name ',
|
||||
name=dom.input(attr.required('yes')),
|
||||
),
|
||||
' ',
|
||||
dom.submitbutton('Create'),
|
||||
),
|
||||
),
|
||||
)
|
||||
remove()
|
||||
name.focus()
|
||||
}),
|
||||
),
|
||||
dom.div(
|
||||
dom.clickbutton('Move to trash', attr.title('Move mailbox, its messages and its mailboxes to the trash.'), async function click() {
|
||||
if (!trashmb) {
|
||||
|
Reference in New Issue
Block a user