chore(deps): update dependency refs-cli to ^1.3.2 (#279) f31aab4b35

This commit is contained in:
jaywcjlove
2023-02-15 01:44:05 +00:00
parent 12c0ef2b2d
commit 9953584d7d
22 changed files with 30 additions and 26 deletions

View File

@ -74,20 +74,21 @@ let inputValue = '';
let activeIndex = 0
document.addEventListener('keydown', (ev) => {
if (ev.key.toLocaleLowerCase() === 'escape') {
const key = ev.key.toLocaleLowerCase();
if (key === 'escape') {
hideSearch();
}
if (ev.metaKey && ev.key.toLocaleLowerCase() === 'k') {
if ((ev.metaKey || ev.ctrlKey) && key === 'k') {
searchBox.classList.contains('show') ? hideSearch() : showSearch();
}
if (ev.key.toLocaleLowerCase() === 'enter') {
if (key === 'enter') {
const url = activeMenu.path || activeMenu?.item.path;
window.location.href = getDocUrl(url);
}
if (ev.key.toLocaleLowerCase() === 'arrowdown') {
if (key === 'arrowdown') {
activeAnchorElm('down')
}
if (ev.key.toLocaleLowerCase() === 'arrowup') {
if (key === 'arrowup') {
activeAnchorElm('up')
}
});