Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions default.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,6 @@

{{> "footer"}}

<script>
let sections = document.querySelectorAll('.section-header');
function handleClick(event) {
const isActive = event.currentTarget.parentNode.classList.contains("active");
if (!isActive) {
event.currentTarget.parentNode.classList.add("active");
} else {
event.currentTarget.parentNode.classList.remove("active");
}
}
sections.forEach(function(section) {
section.addEventListener("click", handleClick);
});
</script>
{{!-- Outputs important scripts - should always be included before closing body tag --}}
{{ghost_foot}}
</body>
Expand Down
6 changes: 6 additions & 0 deletions src/js/app/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import "../../css/app.css"
import './navigation-top';

document.querySelectorAll('.section-header').forEach((header) => {
header.addEventListener('click', function () {
this.parentNode.classList.toggle('active');
});
});

// LiveReload server
if (ENV === 'development') {
const script = document.createElement('script');
Expand Down
Loading