File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 1
- <svg version =" 1.1" xmlns =" http://www.w3.org/2000/svg" width =" 20" height =" 20" viewBox =" 0 0 20 20" >
1
+ <svg class = " {{ className }} " version =" 1.1" xmlns =" http://www.w3.org/2000/svg" width =" 20" height =" 20" viewBox =" 0 0 20 20" >
2
2
<title >cheveron-down</title >
3
3
<path d =" M9.293 12.95l0.707 0.707 5.657-5.657-1.414-1.414-4.243 4.242-4.243-4.242-1.414 1.414z" ></path >
4
4
</svg >
Original file line number Diff line number Diff line change 3
3
<nav class =" c-tree-nav" >
4
4
<ul class =" c-tree-nav" >
5
5
{% for item in navigation .items %}
6
- <li class =" c-tree-nav__item" >
6
+ <li class =" c-tree-nav__item {% if item.subnav %}js-nav-dropdown{% endif %} " >
7
7
{% if item .subnav %}
8
8
<button class =" c-tree-nav__link c-tree-nav__link--btn js-nav-dropdown-trigger" >
9
9
{{ item .label }}
10
+ {% set className = " c-tree-nav__icon" %}
10
11
{% include " components/icon-chevron-down.njk" %}
12
+
11
13
</button >
12
14
13
15
<ul class =" c-tree-nav__subnav" >
Original file line number Diff line number Diff line change 9
9
* 4) If the nav dropdown trigger parent does not have an active class, add it.
10
10
*/
11
11
( function ( ) {
12
+ var navDropdownListItem = document . querySelector ( '.js-nav-dropdown' ) ;
12
13
var navLink = document . querySelectorAll ( '.js-nav-dropdown-trigger' ) ; /* 1 */
13
14
14
15
for ( i = 0 ; i < navLink . length ; i ++ ) {
29
30
} ) ;
30
31
}
31
32
33
+ if ( window . location . href . indexOf ( 'docs' ) > - 1 ) {
34
+ console . log ( 'yellllll' ) ;
35
+ navDropdownListItem . classList . add ( 'is-active' ) ;
36
+ }
37
+
32
38
/**
33
39
* Toggles active class on the primary nav panel
34
40
* 1) Select all nav triggers and cycle through them
You can’t perform that action at this time.
0 commit comments