File tree Expand file tree Collapse file tree 3 files changed +35
-5
lines changed
Expand file tree Collapse file tree 3 files changed +35
-5
lines changed Original file line number Diff line number Diff line change 1717 url : /index.html
1818 navigation :
1919 - content : Introduction
20+ url : /index.html
21+ urlType : fragment
2022 items :
2123 - content : Why Couchbase?
2224 url : ' #'
Original file line number Diff line number Diff line change 150150 var topPositon = currentPageMenu . offsetTop
151151 var leftMenu = document . querySelector ( '.left-sidebar-menu .nav-menu' )
152152 leftMenu . scrollTop = topPositon
153- }
154- } , 200 )
155153
154+ // show depth 0 child element
155+
156+ var otherNavs = document . querySelectorAll ( '.nav-list > .nav-item[data-depth="0"]' )
157+ otherNavs . forEach ( function ( nav ) {
158+ var navSubMenu = Array . from ( nav . querySelector ( 'ul.nav-list' ) . children )
159+ // var navDataDepth = Array.from(nav.querySelector('ul.nav-list'))
160+ navSubMenu . forEach ( function ( item ) {
161+ item . classList . remove ( 'is-inactive' )
162+ } )
163+
164+ // hide main menu for top level navigation -
165+
166+ if ( nav . className . includes ( 'is-current-page' ) ) {
167+ navMenuControl . style . display = 'none'
168+ }
169+
170+ // hide in second level menu
171+ if ( nav . className . includes ( 'is-current-path' ) ) {
172+ otherNavs . forEach ( function ( navItem ) {
173+ if ( ! navItem . className . includes ( 'is-current-path' ) ) {
174+ navItem . classList . add ( 'is-inactive' )
175+ }
176+ } )
177+ }
178+ } )
179+ // if(otherNavs) {
180+
181+ // }
182+ }
183+ } , 100 )
156184 // clearTimeout(scrollCurrentPageMenu, 20000)
157185} ) ( )
Original file line number Diff line number Diff line change 11{{ #if navigation }}
22{{ #each navigation }}
33{{ #if (eq ../crumbAtLevel this )}}
4- {{ #if ( eq ../crumbLevel 0 or eq ../crumbLevel 1 or eq ../crumbLevel 2 )}}
5- <div class =" main-nav-parent new" >
4+ {{ #if ( eq ../crumbLevel 0 or eq ../crumbLevel 1 or eq ../crumbLevel 2 or eq ../crumbLevel 3 )}}
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 >
1414{{ #each navigation }}
1515<li class =" nav-item{{ #if (eq ../crumbAtLevel this )}}
1616{{ ~#if (eq this (last @root.page.breadcrumbs ))}} is-current-page{{ ~else }} is-current-path{{ /if }} is-active
17- {{ ~else if (eq ../level 0 )}} {{!--is-active--}} is-inactive{{ /if }} {{ #if (eq ../crumbAtLevel this (and eq ../level 2 ))}} is-active-depth-2 {{ /if }} " data-depth =" {{ ../level }} " >
17+ {{ ~else if (eq ../level 1 )}} {{!--is-active--}} is-inactive{{ /if }} {{ #if (eq ../crumbAtLevel this (and eq ../level 2 ))}} is-active-depth-2 {{ /if }} " data-depth =" {{ ../level }} " >
1818
1919{{ #if ./content }}
2020<span class =" nav-line " data-depth =" {{ ../level }} " >
You can’t perform that action at this time.
0 commit comments