File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 156156 var otherNavs = document . querySelectorAll ( '.nav-list > .nav-item[data-depth="0"]' )
157157 otherNavs . forEach ( function ( nav ) {
158158 var navSubMenu = Array . from ( nav . querySelector ( 'ul.nav-list' ) . children )
159+ // var navDataDepth = Array.from(nav.querySelector('ul.nav-list'))
159160 navSubMenu . forEach ( function ( item ) {
160161 item . classList . remove ( 'is-inactive' )
161162 } )
163+
164+ // hide main menu for top level navigation -
165+
166+ if ( nav . className . includes ( 'is-current-page' ) ) {
167+ navMenuControl . style . display = 'none'
168+ console . log ( navMenuControl )
169+ }
170+
171+ // hide in second level menu
172+ if ( nav . className . includes ( 'is-current-path' ) ) {
173+ otherNavs . forEach ( function ( navItem ) {
174+ if ( ! navItem . className . includes ( 'is-current-path' ) ) {
175+ navItem . classList . add ( 'is-inactive' )
176+ }
177+ } )
178+ }
162179 } )
163180 // if(otherNavs) {
164181
Original file line number Diff line number Diff line change 22{{ #each navigation }}
33{{ #if (eq ../crumbAtLevel this )}}
44{{ #if ( eq ../crumbLevel 0 or eq ../crumbLevel 1 or eq ../crumbLevel 2 or eq ../crumbLevel 3 )}}
5- <div class =" main-nav-parent new " >
5+ <div class =" main-nav-parent new " data-depth = " {{ ../level }} " >
66<span class =" back-to-menu" ><i class =" fas fa-chevron-left" ></i > Main Menu </span >
77{{!-- <span class="nav-text">{{{./content}}}</span> --}}
88</div >
You can’t perform that action at this time.
0 commit comments