Skip to content

Commit

Permalink
fix: simplify header block navigation element handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Bjoern Weide committed Jan 31, 2025
1 parent 4752b73 commit 6d01edd
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions blocks/header/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,7 @@ export default async function decorate(block) {
const nav = document.createElement('nav');
nav.id = 'nav';
nav.classList.add('nav');
while (fragment.firstElementChild) {
nav.append(fragment.firstElementChild);
const h1s = fragment.querySelectorAll('h1');
h1s.forEach((h1) => {
while (h1.firstChild) {
h1.parentNode.insertBefore(h1.firstChild, h1);
}
h1.parentNode.removeChild(h1);
});
}
while (fragment.firstElementChild) nav.append(fragment.firstElementChild);

const classes = ['brand', 'sections', 'tools'];
classes.forEach((c, i) => {
Expand Down

0 comments on commit 6d01edd

Please sign in to comment.