Skip to content

Commit 8e63e17

Browse files
author
GitLab CI
committed
fix layout with toc sidebar
1 parent 7500dae commit 8e63e17

164 files changed

Lines changed: 756 additions & 377 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

advanced-javascript/call/index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,9 +1023,11 @@ <h2>Kapitel</h2>
10231023
if (!toc) return;
10241024

10251025
const headings = Array.from(
1026-
document.querySelector("#body .span8")?.querySelectorAll("h2[id], h3[id]") ?? []
1026+
document.querySelector("#body")?.querySelectorAll("h2[id], h3[id]") ?? []
10271027
);
1028-
if (headings.length < 2) { toc.style.display = "none"; return; }
1028+
console.log("TOC");
1029+
console.dir(headings);
1030+
if (headings.length < 2) { toc.style.visibility = "hidden"; return; }
10291031

10301032
const h = document.createElement("h3");
10311033
h.textContent = "Auf dieser Seite";

advanced-javascript/index.html

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ <h1><a href="/" title="Web Development">Web Development</a></h1>
4444

4545

4646
<!-- body -->
47-
<article class="row row82">
47+
<article class="row row82" id="body">
48+
49+
<nav id="toc" aria-label="Inhaltsverzeichnis"></nav>
4850

4951
<div class="span8">
5052

@@ -54,7 +56,7 @@ <h2 class="title">Javascript Vertiefung</h2>
5456
</div>
5557

5658

57-
<h3>In diesem Kapitel</h3>
59+
<h3 id="in-diesem-kapitel">In diesem Kapitel</h3>
5860

5961
<p>Fortgeschrittene Javascript Themen</p>
6062

@@ -1055,9 +1057,11 @@ <h2>Kapitel</h2>
10551057
if (!toc) return;
10561058

10571059
const headings = Array.from(
1058-
document.querySelector("#body .span8")?.querySelectorAll("h2[id], h3[id]") ?? []
1060+
document.querySelector("#body")?.querySelectorAll("h2[id], h3[id]") ?? []
10591061
);
1060-
if (headings.length < 2) { toc.style.display = "none"; return; }
1062+
console.log("TOC");
1063+
console.dir(headings);
1064+
if (headings.length < 2) { toc.style.visibility = "hidden"; return; }
10611065

10621066
const h = document.createElement("h3");
10631067
h.textContent = "Auf dieser Seite";

advanced-javascript/nodejs/index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,9 +1158,11 @@ <h2>Kapitel</h2>
11581158
if (!toc) return;
11591159

11601160
const headings = Array.from(
1161-
document.querySelector("#body .span8")?.querySelectorAll("h2[id], h3[id]") ?? []
1161+
document.querySelector("#body")?.querySelectorAll("h2[id], h3[id]") ?? []
11621162
);
1163-
if (headings.length < 2) { toc.style.display = "none"; return; }
1163+
console.log("TOC");
1164+
console.dir(headings);
1165+
if (headings.length < 2) { toc.style.visibility = "hidden"; return; }
11641166

11651167
const h = document.createElement("h3");
11661168
h.textContent = "Auf dieser Seite";

advanced-javascript/regular-expressions/index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,9 +1478,11 @@ <h2>Kapitel</h2>
14781478
if (!toc) return;
14791479

14801480
const headings = Array.from(
1481-
document.querySelector("#body .span8")?.querySelectorAll("h2[id], h3[id]") ?? []
1481+
document.querySelector("#body")?.querySelectorAll("h2[id], h3[id]") ?? []
14821482
);
1483-
if (headings.length < 2) { toc.style.display = "none"; return; }
1483+
console.log("TOC");
1484+
console.dir(headings);
1485+
if (headings.length < 2) { toc.style.visibility = "hidden"; return; }
14841486

14851487
const h = document.createElement("h3");
14861488
h.textContent = "Auf dieser Seite";

advanced-javascript/typescript/index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,9 +1313,11 @@ <h2>Kapitel</h2>
13131313
if (!toc) return;
13141314

13151315
const headings = Array.from(
1316-
document.querySelector("#body .span8")?.querySelectorAll("h2[id], h3[id]") ?? []
1316+
document.querySelector("#body")?.querySelectorAll("h2[id], h3[id]") ?? []
13171317
);
1318-
if (headings.length < 2) { toc.style.display = "none"; return; }
1318+
console.log("TOC");
1319+
console.dir(headings);
1320+
if (headings.length < 2) { toc.style.visibility = "hidden"; return; }
13191321

13201322
const h = document.createElement("h3");
13211323
h.textContent = "Auf dieser Seite";

advanced-javascript/vererbung/index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,9 +1145,11 @@ <h2>Kapitel</h2>
11451145
if (!toc) return;
11461146

11471147
const headings = Array.from(
1148-
document.querySelector("#body .span8")?.querySelectorAll("h2[id], h3[id]") ?? []
1148+
document.querySelector("#body")?.querySelectorAll("h2[id], h3[id]") ?? []
11491149
);
1150-
if (headings.length < 2) { toc.style.display = "none"; return; }
1150+
console.log("TOC");
1151+
console.dir(headings);
1152+
if (headings.length < 2) { toc.style.visibility = "hidden"; return; }
11511153

11521154
const h = document.createElement("h3");
11531155
h.textContent = "Auf dieser Seite";

applied-js-and-css/browser-speicher/index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,9 +1070,11 @@ <h2>Kapitel</h2>
10701070
if (!toc) return;
10711071

10721072
const headings = Array.from(
1073-
document.querySelector("#body .span8")?.querySelectorAll("h2[id], h3[id]") ?? []
1073+
document.querySelector("#body")?.querySelectorAll("h2[id], h3[id]") ?? []
10741074
);
1075-
if (headings.length < 2) { toc.style.display = "none"; return; }
1075+
console.log("TOC");
1076+
console.dir(headings);
1077+
if (headings.length < 2) { toc.style.visibility = "hidden"; return; }
10761078

10771079
const h = document.createElement("h3");
10781080
h.textContent = "Auf dieser Seite";

applied-js-and-css/cors/index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -987,9 +987,11 @@ <h2>Kapitel</h2>
987987
if (!toc) return;
988988

989989
const headings = Array.from(
990-
document.querySelector("#body .span8")?.querySelectorAll("h2[id], h3[id]") ?? []
990+
document.querySelector("#body")?.querySelectorAll("h2[id], h3[id]") ?? []
991991
);
992-
if (headings.length < 2) { toc.style.display = "none"; return; }
992+
console.log("TOC");
993+
console.dir(headings);
994+
if (headings.length < 2) { toc.style.visibility = "hidden"; return; }
993995

994996
const h = document.createElement("h3");
995997
h.textContent = "Auf dieser Seite";

applied-js-and-css/counter/index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,9 +1487,11 @@ <h2>Kapitel</h2>
14871487
if (!toc) return;
14881488

14891489
const headings = Array.from(
1490-
document.querySelector("#body .span8")?.querySelectorAll("h2[id], h3[id]") ?? []
1490+
document.querySelector("#body")?.querySelectorAll("h2[id], h3[id]") ?? []
14911491
);
1492-
if (headings.length < 2) { toc.style.display = "none"; return; }
1492+
console.log("TOC");
1493+
console.dir(headings);
1494+
if (headings.length < 2) { toc.style.visibility = "hidden"; return; }
14931495

14941496
const h = document.createElement("h3");
14951497
h.textContent = "Auf dieser Seite";

applied-js-and-css/dynamisches-formular/index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,9 +1124,11 @@ <h2>Kapitel</h2>
11241124
if (!toc) return;
11251125

11261126
const headings = Array.from(
1127-
document.querySelector("#body .span8")?.querySelectorAll("h2[id], h3[id]") ?? []
1127+
document.querySelector("#body")?.querySelectorAll("h2[id], h3[id]") ?? []
11281128
);
1129-
if (headings.length < 2) { toc.style.display = "none"; return; }
1129+
console.log("TOC");
1130+
console.dir(headings);
1131+
if (headings.length < 2) { toc.style.visibility = "hidden"; return; }
11301132

11311133
const h = document.createElement("h3");
11321134
h.textContent = "Auf dieser Seite";

0 commit comments

Comments
 (0)