fix: 修复开启进入文章动画时文章加载不正常的问题

- 在 pjax:beforeReplace 事件中清理文章列表的 PJAX 加载状态
- 移除 post-preview 元素的 loading 动画和 transform 样式
- 清理 post-list-pjax-loading 类,避免影响新页面
- 优化 post-full 动画,添加 transform-origin 确保动画流畅
- 通过 :not(.no-animation) 选择器支持禁用动画的场景
This commit is contained in:
2026-01-22 15:57:22 +08:00
parent 862f3901b1
commit 0ae1472e79
2 changed files with 12 additions and 1 deletions

View File

@@ -2775,6 +2775,16 @@ $(document).pjax("a[href]:not([no-pjax]):not(.no-pjax):not([target='_blank']):no
// 清理旧页面的资源
cleanupPjaxResources();
// 清理文章列表的 PJAX 加载状态
$(".post-preview.post-pjax-loading").removeClass("post-pjax-loading").css({
"transform": "",
"transition": "",
"left": "",
"width": ""
});
$(".post-preview .loading-css-animation").remove();
$("#main").removeClass("post-list-pjax-loading");
// 更新 UI 状态
if ($("#post_comment", dom[0]).length > 0){
$("#fabtn_go_to_comment").removeClass("d-none");