修复发评论后卡片被挤下去:原评论内容改用class+!important隐藏(Artalk重渲染会抹掉内联display),转换逻辑改幂等自愈
Deploy to Production / pre-check (push) Successful in 50s
Deploy to Production / build (push) Successful in 4m30s
Deploy to Production / deploy-edgeone (push) Canceled after 2m21s
Deploy to Production / finalize (push) Canceled after 0s
Deploy to Production / notify-failure (push) Canceled after 0s
Deploy to Production / pre-check (push) Successful in 50s
Deploy to Production / build (push) Successful in 4m30s
Deploy to Production / deploy-edgeone (push) Canceled after 2m21s
Deploy to Production / finalize (push) Canceled after 0s
Deploy to Production / notify-failure (push) Canceled after 0s
This commit is contained in:
1 parent
0f4761803c
commit
ab94c25273
2 files changed
+14
-1
No files matched your search
@@ -722,9 +722,12 @@ artalk.on('comment-rendered', function(node) {
|
||||
if (!d2 || !el2) return;
|
||||
var content = String(d2.content || '').trim().replace(/\/+$/, '').toLowerCase();
|
||||
if (content !== 'https://usj.cc/link-apply') return;
|
||||
if (el2.querySelector('.atk-fl-apply')) return;
|
||||
|
||||
// 幂等 + 自愈:class 每次渲染都补一次(隐藏原评论内容的 CSS 规则依赖它),
|
||||
// 已有卡片就直接返回,避免 Artalk 重渲染时出现第二张卡片
|
||||
el2.classList.add('atk-fl-apply');
|
||||
if (el2.querySelector('.atk-fl-card')) return;
|
||||
|
||||
el2.style.cursor = 'pointer';
|
||||
el2.title = '点击申请友链';
|
||||
|
||||
|
||||
Reference in new issue
Block a user