mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 13:04:38 +03:00
when clearing search, open inbox
feedback from jonathan, thanks!
This commit is contained in:
@ -4098,7 +4098,7 @@ const init = async () => {
|
||||
dom.clickbutton(
|
||||
'x',
|
||||
style({padding: '0 .25em'}),
|
||||
attr.arialabel('Clear refinement filters'),
|
||||
attr.arialabel('Clear refinement filters.'),
|
||||
attr.title('Clear refinement filters.'),
|
||||
async function click(e: MouseEvent) {
|
||||
settingsPut({...settings, refine: ''})
|
||||
@ -4349,38 +4349,27 @@ const init = async () => {
|
||||
searchView.updateForm()
|
||||
},
|
||||
),
|
||||
dom.clickbutton('x', attr.arialabel('Cancel and clear search.'), attr.title('Cancel and clear search.'), style({marginLeft: '.25em', padding: '0 .3em'}), async function click() {
|
||||
searchbarElem.value = ''
|
||||
if (!search.active) {
|
||||
return
|
||||
}
|
||||
clearList()
|
||||
unloadSearch()
|
||||
updatePageTitle()
|
||||
setLocationHash()
|
||||
if (requestID) {
|
||||
requestSequence++
|
||||
requestID = requestSequence
|
||||
const query = {
|
||||
OrderAsc: settings.orderAsc,
|
||||
Filter: newFilter(),
|
||||
NotFilter: newNotFilter()
|
||||
dom.clickbutton('x',
|
||||
attr.arialabel('Cancel and clear search and open Inbox.'),
|
||||
attr.title('Cancel and clear search and open Inbox.'),
|
||||
style({marginLeft: '.25em', padding: '0 .3em'}),
|
||||
async function click() {
|
||||
searchbarElem.value = ''
|
||||
if (!search.active) {
|
||||
return
|
||||
}
|
||||
const page = {AnchorMessageID: 0, Count: 0, DestMessageID: 0}
|
||||
const request = {
|
||||
ID: requestID,
|
||||
SSEID: sseID,
|
||||
ViewID: viewID,
|
||||
Cancel: true,
|
||||
Query: query,
|
||||
Page: page,
|
||||
|
||||
const mb = mailboxlistView.findMailboxByName('Inbox')
|
||||
if (!mb) {
|
||||
window.alert('Cannot find inbox.')
|
||||
return
|
||||
}
|
||||
dom._kids(queryactivityElem)
|
||||
await withStatus('Canceling query', client.Request(request))
|
||||
} else {
|
||||
dom._kids(queryactivityElem)
|
||||
}
|
||||
}),
|
||||
await mailboxlistView.openMailboxID(mb.ID, true)
|
||||
const f = newFilter()
|
||||
f.MailboxID = mb.ID
|
||||
await withStatus('Requesting messages', requestNewView(true, f, newNotFilter()))
|
||||
},
|
||||
),
|
||||
async function submit(e: SubmitEvent) {
|
||||
e.preventDefault()
|
||||
await searchView.submit()
|
||||
|
Reference in New Issue
Block a user