File tree Expand file tree Collapse file tree 2 files changed +6
-14
lines changed
Expand file tree Collapse file tree 2 files changed +6
-14
lines changed Original file line number Diff line number Diff line change 2727
2828 {{> " footer" }}
2929
30- <script >
31- let sections = document .querySelectorAll (' .section-header' );
32- function handleClick (event ) {
33- const isActive = event .currentTarget .parentNode .classList .contains (" active" );
34- if (! isActive) {
35- event .currentTarget .parentNode .classList .add (" active" );
36- } else {
37- event .currentTarget .parentNode .classList .remove (" active" );
38- }
39- }
40- sections .forEach (function (section ) {
41- section .addEventListener (" click" , handleClick);
42- });
43- </script >
4430 {{!-- Outputs important scripts - should always be included before closing body tag --}}
4531 {{ ghost_foot }}
4632 </body >
Original file line number Diff line number Diff line change 11import "../../css/app.css"
22import './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
511if ( ENV === 'development' ) {
612 const script = document . createElement ( 'script' ) ;
You can’t perform that action at this time.
0 commit comments