File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change 36
36
} )
37
37
38
38
find ( menuPanel , '.nav-item-toggle' ) . forEach ( function ( btn ) {
39
- var li = btn . parentElement
40
- btn . addEventListener ( 'click' , toggleActive . bind ( li ) )
41
- var navItemSpan = findNextElement ( btn , '.nav-text' )
42
- if ( navItemSpan ) {
43
- navItemSpan . style . cursor = 'pointer'
44
- navItemSpan . addEventListener ( 'click' , toggleActive . bind ( li ) )
39
+ btn . addEventListener ( 'click' , toggleActive . bind ( btn . parentElement ) )
40
+ var nextElement = btn . nextElementSibling
41
+ if ( nextElement && nextElement . classList . contains ( 'nav-text' ) ) {
42
+ nextElement . style . cursor = 'pointer'
43
+ nextElement . addEventListener ( 'click' , toggleActive . bind ( btn . parentElement ) )
45
44
}
46
45
} )
47
46
160
159
function find ( from , selector ) {
161
160
return [ ] . slice . call ( from . querySelectorAll ( selector ) )
162
161
}
163
-
164
- function findNextElement ( from , selector ) {
165
- var el = from . nextElementSibling
166
- return el && selector ? el [ el . matches ? 'matches' : 'msMatchesSelector' ] ( selector ) && el : el
167
- }
168
162
} ) ( )
You can’t perform that action at this time.
0 commit comments