fix: 修复评论区回复按钮第一次点击无效的问题
- 为 .comment-operations 添加 pointer-events: none(opacity: 0 时) - hover 时恢复 pointer-events: auto - 问题原因:按钮不可见时仍能接收点击事件,导致第一次点击被'空'按钮捕获 - 恢复 jQuery 事件委托方式绑定回复按钮点击事件
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user