mirror of
https://github.com/glassflame/glassflame.github.io.git
synced 2024-11-24 09:04:25 +00:00
Improve wikilinks
This commit is contained in:
parent
078e36d30b
commit
2793449bb6
1 changed files with 5 additions and 4 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue