|
|
@ -7,10 +7,11 @@
|
|
|
|
return template.content.firstChild
|
|
|
|
return template.content.firstChild
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const pathRegex = /\.\.(\/\.\.)*/
|
|
|
|
const pathRegex = /\.\.?(\/\.\.)*/
|
|
|
|
document.addEventListener("DOMContentLoaded", () => {
|
|
|
|
document.addEventListener("DOMContentLoaded", () => {
|
|
|
|
[...document.getElementsByClassName("internal-link")]
|
|
|
|
[...document.getElementsByClassName("internal-link")]
|
|
|
|
.forEach(li => {
|
|
|
|
.forEach(li => {
|
|
|
|
|
|
|
|
console.log(li.dataset.src.replace(pathRegex, ''))
|
|
|
|
const linkDest = content[li.dataset.src.replace(pathRegex, '')]
|
|
|
|
const linkDest = content[li.dataset.src.replace(pathRegex, '')]
|
|
|
|
if (linkDest) {
|
|
|
|
if (linkDest) {
|
|
|
|
const popoverElement = `<div class="popover">
|
|
|
|
const popoverElement = `<div class="popover">
|
|
|
|