Skip to content

Commit cadf13e

Browse files
committed
Merge branch 'main' into jrr/code-block-formatting
2 parents 107e9f4 + 61fe987 commit cadf13e

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

default.hbs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,6 @@
3131

3232
{{> "footer"}}
3333

34-
<script>
35-
let sections = document.querySelectorAll('.section-header');
36-
function handleClick(event) {
37-
const isActive = event.currentTarget.parentNode.classList.contains("active");
38-
if (!isActive) {
39-
event.currentTarget.parentNode.classList.add("active");
40-
} else {
41-
event.currentTarget.parentNode.classList.remove("active");
42-
}
43-
}
44-
sections.forEach(function(section) {
45-
section.addEventListener("click", handleClick);
46-
});
47-
</script>
4834
{{!-- Outputs important scripts - should always be included before closing body tag --}}
4935
{{ghost_foot}}
5036
</body>

src/js/app/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import "../../css/app.css"
22
import './navigation-top';
33

4+
document.querySelectorAll('.section-header').forEach((header) => {
5+
header.addEventListener('click', function () {
6+
this.parentNode.classList.toggle('active');
7+
});
8+
});
9+
410
// LiveReload server
511
if (ENV === 'development') {
612
const script = document.createElement('script');

0 commit comments

Comments
 (0)