mirror of
https://codeberg.org/vlw/vlw.se.git
synced 2025-09-13 13:03:41 +02:00
feat: scroll page to top on Vegvisir navigations (#21)
Simple but effective Reviewed-on: https://codeberg.org/vlw/vlw.se/pulls/21
This commit is contained in:
parent
359342c7f7
commit
2fa62991f9
1 changed files with 5 additions and 0 deletions
|
@ -47,4 +47,9 @@ const CLASSNAME_SEARCHBOX_ACTIVE = "searchboxActive";
|
|||
new vv.Navigation(`/search?q=${event.target.value}`).navigate(searchResultsElement);
|
||||
}, 100);
|
||||
});
|
||||
}
|
||||
|
||||
// Scroll page to top on navigation
|
||||
{
|
||||
document.addEventListener(vegvisir.Navigation.EVENTS.FINISHED, () => window.scrollTo({top: 0}));
|
||||
}
|
Loading…
Add table
Reference in a new issue