File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change 4
4
var sidebar = document . querySelector ( 'aside.toc.sidebar' )
5
5
if ( ! sidebar ) return
6
6
if ( document . querySelector ( 'body.-toc' ) ) return sidebar . parentNode . removeChild ( sidebar )
7
- var levels = parseInt ( sidebar . dataset . levels || 2 )
7
+ var levels = parseInt ( sidebar . dataset . levels || 2 , 10 )
8
8
if ( levels < 0 ) return
9
9
10
10
var articleSelector = 'article.doc'
30
30
link . textContent = heading . textContent
31
31
links [ ( link . href = '#' + heading . id ) ] = link
32
32
var listItem = document . createElement ( 'li' )
33
- listItem . dataset . level = parseInt ( heading . nodeName . slice ( 1 ) ) - 1
33
+ listItem . dataset . level = parseInt ( heading . nodeName . slice ( 1 ) , 10 ) - 1
34
34
listItem . appendChild ( link )
35
35
accum . appendChild ( listItem )
36
36
return accum
Original file line number Diff line number Diff line change 13
13
if ( menu . classList . toggle ( 'is-active' ) ) {
14
14
menu . style . maxHeight = ''
15
15
var expectedMaxHeight = window . innerHeight - Math . round ( menu . getBoundingClientRect ( ) . top )
16
- var actualMaxHeight = parseInt ( window . getComputedStyle ( menu ) . maxHeight )
16
+ var actualMaxHeight = parseInt ( window . getComputedStyle ( menu ) . maxHeight , 10 )
17
17
if ( actualMaxHeight !== expectedMaxHeight ) menu . style . maxHeight = expectedMaxHeight + 'px'
18
18
}
19
19
}
You can’t perform that action at this time.
0 commit comments