chore: fixes
This commit is contained in:
parent
a91757e135
commit
2c09dbd6cd
1 changed files with 14 additions and 15 deletions
33
legacy.html
33
legacy.html
|
|
@ -152,26 +152,25 @@ function showAbout(event) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find the element that contains kirby19.gif
|
const startImg = section.querySelector('img[src*="kirby19.gif"]');
|
||||||
const startEl = section.querySelector('img[src*="kirby19.gif"]');
|
|
||||||
|
|
||||||
if (startEl) {
|
if (!startImg) {
|
||||||
// Remove everything BEFORE the Kirby image
|
|
||||||
let current = section.firstChild;
|
|
||||||
|
|
||||||
while (current && current !== startEl) {
|
|
||||||
const next = current.nextSibling;
|
|
||||||
current.remove();
|
|
||||||
current = next;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Now render from Kirby onward
|
|
||||||
target.innerHTML = section.outerHTML;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
// fallback: if image not found, show full section
|
|
||||||
target.innerHTML = section.outerHTML;
|
target.innerHTML = section.outerHTML;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Build a new container starting from Kirby
|
||||||
|
const newSection = document.createElement("div");
|
||||||
|
newSection.id = "aboutSection";
|
||||||
|
|
||||||
|
let node = startImg;
|
||||||
|
|
||||||
|
while (node) {
|
||||||
|
newSection.appendChild(node.cloneNode(true));
|
||||||
|
node = node.nextSibling;
|
||||||
|
}
|
||||||
|
|
||||||
|
target.innerHTML = newSection.outerHTML;
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue