mirror of
https://github.com/maikka39/Personal-Website.git
synced 2026-10-02 14:46:25 +00:00
Show checkmark after copying/selecting heading
This commit is contained in:
@@ -35,7 +35,18 @@ window.addEventListener("load", () => {
|
||||
heading.classList.add("article-heading");
|
||||
|
||||
anchor.addEventListener("click", (e) => {
|
||||
e.preventDefault();
|
||||
|
||||
window.history.replaceState({}, "", anchor.href);
|
||||
navigator.clipboard.writeText(anchor.href);
|
||||
|
||||
document
|
||||
.querySelectorAll(".current-heading")
|
||||
.forEach((elem) =>
|
||||
elem.classList.remove("current-heading")
|
||||
);
|
||||
|
||||
anchor.classList.add("current-heading");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user