feat(tag): link

This commit is contained in:
Anhgelus Morhtuuzh 2024-11-14 15:35:21 +01:00
parent 2621bc5978
commit 44173f34c2
No known key found for this signature in database
GPG key ID: CAD341EFA92DDDE5
4 changed files with 10 additions and 3 deletions

View file

@ -1,7 +1,9 @@
function setupEvents() {
document.querySelectorAll<HTMLElement>(".tag")?.forEach(t => {
t.addEventListener("click", _ => {
// t.classList.toggle("active")
const link = t.getAttribute("data-href")
if (link === null || link === "") return
window.open(link)
})
})