From 032e56c794f77f80bc50fc7a5d820d2ddc3de65c Mon Sep 17 00:00:00 2001 From: ZxR <3193291180@qq.com> Date: Wed, 13 May 2026 20:30:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DhasResults=E8=AF=AF=E6=8A=8A?= =?UTF-8?q?=E5=BC=95=E5=AF=BC=E5=86=85=E9=93=BE=E6=8E=A5=E5=BD=93=E6=88=90?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E7=BB=93=E6=9E=9C=E5=AF=BC=E8=87=B4=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E8=A2=AB=E6=B8=85=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/js/search-no-result.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/static/js/search-no-result.js b/static/js/search-no-result.js index 6f0135f..efbc9f2 100644 --- a/static/js/search-no-result.js +++ b/static/js/search-no-result.js @@ -53,8 +53,12 @@ function hasResults() { var listbox = document.querySelector('[role="listbox"]'); if (!listbox) return false; - // 有 li/a/[role=option] 子项才算有搜索结果 - return listbox.querySelectorAll('li, a, [role="option"]').length > 0; + // 检查是否有搜索结果项(排除我们引导里的链接) + var items = listbox.querySelectorAll('li, a, [role="option"]'); + for (var i = 0; i < items.length; i++) { + if (!items[i].closest('#' + GUIDE_ID)) return true; + } + return false; } function showGuide() {