From 8f3f80d2dfd314927a3c0586d52d52c70004b919 Mon Sep 17 00:00:00 2001 From: nanhaoluo <3075912108@qq.com> Date: Fri, 16 Jan 2026 21:03:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=AF=84=E8=AE=BA?= =?UTF-8?q?=E5=8C=BA=E5=9B=9E=E5=A4=8D=E6=8C=89=E9=92=AE=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E6=AC=A1=E7=82=B9=E5=87=BB=E6=97=A0=E6=95=88=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 为 .comment-operations 添加 pointer-events: none(opacity: 0 时) - hover 时恢复 pointer-events: auto - 问题原因:按钮不可见时仍能接收点击事件,导致第一次点击被'空'按钮捕获 - 恢复 jQuery 事件委托方式绑定回复按钮点击事件 --- argontheme.js | 10 ++-------- style.css | 2 ++ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/argontheme.js b/argontheme.js index d762e47..f93104a 100644 --- a/argontheme.js +++ b/argontheme.js @@ -1017,15 +1017,9 @@ if (argonConfig.waterflow_columns != "1") { $("#post_comment").removeClass("post-comment-force-privatemode-on post-comment-force-privatemode-off"); } - // 使用原生事件委托确保第一次点击也能响应 - document.addEventListener('click', function(e) { - let target = e.target.closest('.comment-reply'); - if (target) { - reply(target.getAttribute('data-id')); - } + $(document).on("click" , ".comment-reply" , function(){ + reply(this.getAttribute("data-id")); }); - - // 保留 jQuery 事件绑定用于 PJAX 兼容 $(document).on("click pjax:click" , "#post_comment_reply_cancel" , function(){ cancelReply(); }); diff --git a/style.css b/style.css index 3ff44ed..2e619e6 100644 --- a/style.css +++ b/style.css @@ -5322,11 +5322,13 @@ html.darkmode .comment-item-avatar .avatar { background: var(--color-widgets); border-radius: var(--m3-shape-sm, 6px); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); + pointer-events: none; } .comment-item:hover .comment-operations { opacity: 1; transform: translateY(0); + pointer-events: auto; } html.darkmode .comment-operations {