mirror of
https://github.com/mjl-/mox.git
synced 2025-06-28 12:58:16 +03:00
when clearing search, open inbox
feedback from jonathan, thanks!
This commit is contained in:
parent
038b478d16
commit
f48a53726e
@ -3993,7 +3993,7 @@ const init = async () => {
|
|||||||
await selectLabel();
|
await selectLabel();
|
||||||
}));
|
}));
|
||||||
}), labels.length === 0 ? dom.div('No labels yet, set one on a message first.') : []));
|
}), labels.length === 0 ? dom.div('No labels yet, set one on a message first.') : []));
|
||||||
})), ' ', dom.clickbutton('x', style({ padding: '0 .25em' }), attr.arialabel('Clear refinement filters'), attr.title('Clear refinement filters.'), async function click(e) {
|
})), ' ', dom.clickbutton('x', style({ padding: '0 .25em' }), attr.arialabel('Clear refinement filters.'), attr.title('Clear refinement filters.'), async function click(e) {
|
||||||
settingsPut({ ...settings, refine: '' });
|
settingsPut({ ...settings, refine: '' });
|
||||||
refineToggleActive(e.target);
|
refineToggleActive(e.target);
|
||||||
await withStatus('Requesting messages', requestNewView(false));
|
await withStatus('Requesting messages', requestNewView(false));
|
||||||
@ -4162,38 +4162,20 @@ const init = async () => {
|
|||||||
ensureSearchView();
|
ensureSearchView();
|
||||||
}
|
}
|
||||||
searchView.updateForm();
|
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() {
|
}), 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 = '';
|
searchbarElem.value = '';
|
||||||
if (!search.active) {
|
if (!search.active) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
clearList();
|
const mb = mailboxlistView.findMailboxByName('Inbox');
|
||||||
unloadSearch();
|
if (!mb) {
|
||||||
updatePageTitle();
|
window.alert('Cannot find inbox.');
|
||||||
setLocationHash();
|
return;
|
||||||
if (requestID) {
|
|
||||||
requestSequence++;
|
|
||||||
requestID = requestSequence;
|
|
||||||
const query = {
|
|
||||||
OrderAsc: settings.orderAsc,
|
|
||||||
Filter: newFilter(),
|
|
||||||
NotFilter: newNotFilter()
|
|
||||||
};
|
|
||||||
const page = { AnchorMessageID: 0, Count: 0, DestMessageID: 0 };
|
|
||||||
const request = {
|
|
||||||
ID: requestID,
|
|
||||||
SSEID: sseID,
|
|
||||||
ViewID: viewID,
|
|
||||||
Cancel: true,
|
|
||||||
Query: query,
|
|
||||||
Page: page,
|
|
||||||
};
|
|
||||||
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) {
|
}), async function submit(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
await searchView.submit();
|
await searchView.submit();
|
||||||
|
@ -4098,7 +4098,7 @@ const init = async () => {
|
|||||||
dom.clickbutton(
|
dom.clickbutton(
|
||||||
'x',
|
'x',
|
||||||
style({padding: '0 .25em'}),
|
style({padding: '0 .25em'}),
|
||||||
attr.arialabel('Clear refinement filters'),
|
attr.arialabel('Clear refinement filters.'),
|
||||||
attr.title('Clear refinement filters.'),
|
attr.title('Clear refinement filters.'),
|
||||||
async function click(e: MouseEvent) {
|
async function click(e: MouseEvent) {
|
||||||
settingsPut({...settings, refine: ''})
|
settingsPut({...settings, refine: ''})
|
||||||
@ -4349,38 +4349,27 @@ const init = async () => {
|
|||||||
searchView.updateForm()
|
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() {
|
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 = ''
|
searchbarElem.value = ''
|
||||||
if (!search.active) {
|
if (!search.active) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
clearList()
|
|
||||||
unloadSearch()
|
const mb = mailboxlistView.findMailboxByName('Inbox')
|
||||||
updatePageTitle()
|
if (!mb) {
|
||||||
setLocationHash()
|
window.alert('Cannot find inbox.')
|
||||||
if (requestID) {
|
return
|
||||||
requestSequence++
|
|
||||||
requestID = requestSequence
|
|
||||||
const query = {
|
|
||||||
OrderAsc: settings.orderAsc,
|
|
||||||
Filter: newFilter(),
|
|
||||||
NotFilter: newNotFilter()
|
|
||||||
}
|
}
|
||||||
const page = {AnchorMessageID: 0, Count: 0, DestMessageID: 0}
|
await mailboxlistView.openMailboxID(mb.ID, true)
|
||||||
const request = {
|
const f = newFilter()
|
||||||
ID: requestID,
|
f.MailboxID = mb.ID
|
||||||
SSEID: sseID,
|
await withStatus('Requesting messages', requestNewView(true, f, newNotFilter()))
|
||||||
ViewID: viewID,
|
},
|
||||||
Cancel: true,
|
),
|
||||||
Query: query,
|
|
||||||
Page: page,
|
|
||||||
}
|
|
||||||
dom._kids(queryactivityElem)
|
|
||||||
await withStatus('Canceling query', client.Request(request))
|
|
||||||
} else {
|
|
||||||
dom._kids(queryactivityElem)
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
async function submit(e: SubmitEvent) {
|
async function submit(e: SubmitEvent) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
await searchView.submit()
|
await searchView.submit()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user