chore: fixes
This commit is contained in:
parent
bacf4cfcb2
commit
77a445393f
1 changed files with 23 additions and 5 deletions
28
legacy.html
28
legacy.html
|
|
@ -110,7 +110,6 @@ function showMembers(event) {
|
|||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
function showAbout(event) {
|
||||
if (event) event.preventDefault();
|
||||
|
||||
|
|
@ -127,11 +126,30 @@ function showAbout(event) {
|
|||
const temp = document.createElement("div");
|
||||
temp.innerHTML = html;
|
||||
|
||||
const section = temp.querySelector("article.home-text.text-containers-secondary-bg");
|
||||
const article = temp.querySelector("article.home-text.text-containers-secondary-bg");
|
||||
|
||||
target.innerHTML = section
|
||||
? section.innerHTML
|
||||
: "<h2>About</h2><p>Missing article.home-text.text-containers-secondary-bg in about.html</p>";
|
||||
if (!article) {
|
||||
target.innerHTML = "<h2>About</h2><p>Missing article.home-text.text-containers-secondary-bg in about.html</p>";
|
||||
return;
|
||||
}
|
||||
|
||||
// Convert children so we can get everything after the article
|
||||
const children = Array.from(temp.children);
|
||||
const index = children.indexOf(article);
|
||||
|
||||
let afterArticle = "";
|
||||
|
||||
if (index !== -1) {
|
||||
afterArticle = children
|
||||
.slice(index + 1)
|
||||
.map(el => el.outerHTML)
|
||||
.join("");
|
||||
}
|
||||
|
||||
target.innerHTML = `
|
||||
${article.outerHTML}
|
||||
${afterArticle}
|
||||
`;
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue