avoid loading inbox by default/blur input on enter key
This commit is contained in:
parent
777f0a1016
commit
9038231fee
1 changed files with 8 additions and 3 deletions
|
@ -255,12 +255,17 @@ function escapeHtml(text) {
|
|||
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
const params = new URLSearchParams(location.search);
|
||||
const query = params.get('q') || 'tag:inbox';
|
||||
const query = params.get('q');
|
||||
document.getElementById('search').value = query;
|
||||
loadThreads(query);
|
||||
if (query !== '') {
|
||||
loadThreads(query);
|
||||
}
|
||||
|
||||
document.getElementById('search').addEventListener('keypress', (e) => {
|
||||
if (e.key === 'Enter') search();
|
||||
if (e.key === 'Enter') {
|
||||
search();
|
||||
e.target.blur();
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener('keydown', (e) => {
|
||||
|
|
Loading…
Add table
Reference in a new issue