Skip to content

Commit

Permalink
fixed headings bug
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-thepie committed Sep 19, 2024
1 parent 160007a commit abbceec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,15 @@ <h3>Explanation of Levels:</h3>
</section>

<section class="level hidden" data-level="L4">
<h2 class="levelhead"></h2>

</section>
<section class="level hidden" data-level="L5">
<h2 class="levelhead"></h2>

</section>
<section class="level hidden" data-level="L6">
<h2 class="levelhead"></h2>

</section>
<section class="level hidden" data-level="L7">
<h2 class="levelhead"></h2>
</section>

</main>
Expand All @@ -53,6 +52,7 @@ <h2 class="levelhead"></h2>

<template id="course-plan">
<section class="plan">
<h2 class="levelhead"></h2>
<article data-day="monday">
<h4>Monday</h4>
<div class="events-list">
Expand Down
5 changes: 3 additions & 2 deletions docs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,13 @@ function hideAllPlans() {
function populate() {
for (const [level, plans] of Object.entries(data.plans)) {
const levelSection = ui.main.querySelector(`section[data-level="${level}"]`);
const levelHead = levelSection.querySelector('h2');


for (const plan of plans) {
levelHead.textContent = `${plan.title}: Level ${level.charAt(1)}`;
const planSect = document.querySelector('#course-plan').content.cloneNode(true).firstElementChild;
levelSection.append(planSect);
const levelHead = planSect.querySelector('.levelhead');
levelHead.textContent = `${plan.title}: Level ${level.charAt(1)}`;
planSect.dataset.course = plan.code;
planSect.classList.add('hidden');
// handle common events for all courses first
Expand Down

0 comments on commit abbceec

Please sign in to comment.