diff --git a/src/components/widget/NewPostNotification.astro b/src/components/widget/NewPostNotification.astro index 9855f4f72..de52ae69e 100644 --- a/src/components/widget/NewPostNotification.astro +++ b/src/components/widget/NewPostNotification.astro @@ -1,3 +1,26 @@ + +
-
+
@@ -198,7 +221,7 @@ if (isUpdated && post.diff) { diffButton = ` - `; } @@ -329,16 +352,22 @@ }; // Add event delegation for toggles - list.addEventListener('click', (e) => { - const btn = e.target.closest('[data-diff-toggle]'); - if (btn) { - const targetId = btn.getAttribute('data-diff-toggle'); - const target = document.getElementById(targetId); - if (target) { - target.classList.toggle('hidden'); - } + // Remove and re-add to ensure freshness + // Or better, just use one listener on the container that always works + // The previous check if (!list.hasAttribute('data-listening')) might be persisting across re-renders improperly if Astro keeps DOM + // Let's make it robust: + + // Remove existing listener if possible? No easy way without reference. + // Instead, let's use a unique attribute or just replace the node (expensive) + // Or simpler: assign onclick handler to the list container which bubbles up + + // Use a window-level handler for maximum robustness, filtering by ID + window.toggleDiff = function(safeId) { + const target = document.getElementById(safeId); + if (target) { + target.classList.toggle('hidden'); } - }); + }; // Auto-open panel on first load if it's high priority? // Or keep it minimized to be less intrusive? diff --git a/src/config.ts b/src/config.ts index c99d54379..4ea8bb5c8 100644 --- a/src/config.ts +++ b/src/config.ts @@ -13,7 +13,7 @@ import { LinkPreset } from "./types/config"; export const noticeConfig: NoticeConfig = { enable: true, - level: "warning", + level: "info", content: "我们刚刚添加了文章更新系统,自此之后的每次文章更新都会通过右下角的小铃铛提醒您。", }; diff --git a/src/content/posts/pin.md b/src/content/posts/pin.md index dcf2c6586..fa3c254fa 100644 --- a/src/content/posts/pin.md +++ b/src/content/posts/pin.md @@ -25,6 +25,8 @@ description: 关于如何联系二叉树树~ # 非官方 +123123123121231231231212312312312123123123121231231231212312312312123123123121231231231212312312312123123123121231231231212312312312123123123121231231231212312312312123123123121231231231212312312312123123123121231231231212312312312123123123121231231231212312312312123123123121231231231212312312312123123123121231231231212312312312123123123121231231231212312312312123123123121231231231212312312312123123123121231231231212312312312123123123121231231231212312312312 + > 粉丝自建 [Telegram: View @blog2x](https://t.me/blog2x) \ No newline at end of file