chore: fixes

This commit is contained in:
MattTheTekie 2026-04-23 18:08:22 -04:00
commit 77a445393f

View file

@ -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);