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 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 >
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