aboutsummaryrefslogtreecommitdiff
path: root/index.ts
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <anhgelus.morhtuuzh@proton.me>2024-11-14 15:35:21 +0100
committerAnhgelus Morhtuuzh <anhgelus.morhtuuzh@proton.me>2024-11-14 15:35:21 +0100
commit44173f34c293d011019b84be7095039eac977c5b (patch)
tree7f6259d439c0eb6b25e2e73c24fb5dd7a63edccf /index.ts
parent2621bc5978fc7f6f24d2f0ba91715c01c62b43a9 (diff)
feat(tag): link
Diffstat (limited to 'index.ts')
-rw-r--r--index.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/index.ts b/index.ts
index 77a004a..e4b19d6 100644
--- a/index.ts
+++ b/index.ts
@@ -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)
})
})