1
Fork 0
mirror of https://github.com/glassflame/glassflame.github.io.git synced 2024-10-16 14:37:33 +00:00

Improve wikilinks

This commit is contained in:
Steffo 2023-10-19 15:40:52 +02:00
parent 078e36d30b
commit 2793449bb6

View file

@ -17,11 +17,12 @@ export class WikilinkElement extends HTMLElement {
const templateElement = document.getElementById("template-wikilink")
const instanceElement = templateElement.content.cloneNode(true)
this.anchorElement = this.querySelector(".wikilink")
this.title = this.getWikilinkWref()
const wref = this.getWikilinkWref()
this.anchorElement = this.querySelector('[slot="wikilink-text"]')
this.anchorElement.addEventListener("click", function() {
console.warn("Would move to", wref, "but navigation is not yet implemented.")
})
const shadow = this.attachShadow({ mode: "open" })
shadow.appendChild(instanceElement)