Format JS

This commit is contained in:
Claudio Yanes 2022-03-07 18:25:02 +00:00
parent 30a6697c5b
commit 29e2934dc2
3 changed files with 361 additions and 362 deletions

View File

@ -218,4 +218,3 @@ async function drawGraph(url, baseUrl, pathColors, depth, enableDrag, enableLege
.attr("y", d => d.y)
});
}

View File

@ -5,13 +5,13 @@ function htmlToElement(html) {
return template.content.firstChild
}
function initPopover(base) {
const baseUrl = base.replace(window.location.origin, "") // is this useless?
function initPopover(baseURL) {
const basePath = baseURL.replace(window.location.origin, "")
document.addEventListener("DOMContentLoaded", () => {
fetchData.then(({ content }) => {
const links = [...document.getElementsByClassName("internal-link")]
links.forEach(li => {
const linkDest = content[li.dataset.src.replace(baseUrl, "")]
const linkDest = content[li.dataset.src.replace(basePath, "")]
// const linkDest = content[li.dataset.src]
if (linkDest) {
const popoverElement = `<div class="popover">