2026-05-25 16:16:53 +02:00
|
|
|
export class NotificationManager {
|
|
|
|
|
constructor() {
|
|
|
|
|
this.initHashScroll();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
initHashScroll() {
|
|
|
|
|
const hash = window.location.hash;
|
|
|
|
|
if (!hash.startsWith("#comment-")) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
window.addEventListener("load", () => {
|
|
|
|
|
const target = document.getElementById(hash.slice(1));
|
|
|
|
|
if (!target) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2026-06-06 16:31:42 +02:00
|
|
|
target.scrollIntoView({ block: "center" });
|
2026-06-08 17:38:33 +02:00
|
|
|
target.classList.add("comment-highlight");
|
2026-05-25 16:16:53 +02:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|