From 13a6f7f4d506edcf8d12de79637d82985782684e Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Tue, 22 Nov 2022 09:35:17 +0800 Subject: [PATCH] website: fix search page turning error. #32 --- scripts/js/main.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/js/main.js b/scripts/js/main.js index 8d5b045..c0dd32e 100644 --- a/scripts/js/main.js +++ b/scripts/js/main.js @@ -78,7 +78,8 @@ document.addEventListener('keydown', (ev) => { searchBox.classList.contains('show') ? hideSearch() : showSearch(); } if (ev.key.toLocaleLowerCase() === 'enter') { - window.location.href = getDocUrl(activeMenu.path) + const url = activeMenu.path || activeMenu?.item.path; + window.location.href = getDocUrl(url); } if (ev.key.toLocaleLowerCase() === 'arrowdown') { activeAnchorElm('down')