1
Fork 0
mirror of https://github.com/glassflame/glassflame.github.io.git synced 2024-11-24 17:14:26 +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 templateElement = document.getElementById("template-wikilink")
const instanceElement = templateElement.content.cloneNode(true) const instanceElement = templateElement.content.cloneNode(true)
this.anchorElement = this.querySelector(".wikilink") const wref = this.getWikilinkWref()
this.title = 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" }) const shadow = this.attachShadow({ mode: "open" })
shadow.appendChild(instanceElement) shadow.appendChild(instanceElement)