@@ -135,10 +135,6 @@ ContentsViewer.private.setupOutline = () => {
135135return ;
136136}
137137
138- if ( cv . elements . contentBody . children . length == 0 ) {
139- return ;
140- }
141-
142138var docOutlineNavi = cv . elements . rightColumn . getElementsByClassName ( "navi" ) ?. [ 0 ] ;
143139if ( ! docOutlineNavi ) {
144140return ;
@@ -149,19 +145,21 @@ ContentsViewer.private.setupOutline = () => {
149145var navWrapper = document . querySelector ( "#doc-outline-embeded>.nav-wrapper" ) ;
150146navWrapper . appendChild ( naviEmbeded ) ;
151147
152- if ( ( cv . private . createSectionTreeHelper (
153- cv . elements . contentBody , docOutlineNavi , 0 ,
154- cv . private . sectionListInColumn ,
155- cv . private . sectionListInMainContent ) ) != 0 ) {
156- docOutlineNavi . removeChild ( docOutlineNavi . firstChild ) ;
157- }
148+ if ( cv . elements . contentBody . children . length != 0 ) {
149+ if ( ( cv . private . createSectionTreeHelper (
150+ cv . elements . contentBody , docOutlineNavi , 0 ,
151+ cv . private . sectionListInColumn ,
152+ cv . private . sectionListInMainContent ) ) != 0 ) {
153+ docOutlineNavi . removeChild ( docOutlineNavi . firstChild ) ;
154+ }
158155
159- if ( ( cv . private . createSectionTreeHelper (
160- cv . elements . contentBody , naviEmbeded , 0 ,
161- [ ] , [ ] ) ) != 0 ) {
162- naviEmbeded . removeChild ( naviEmbeded . firstChild ) ;
156+ if ( ( cv . private . createSectionTreeHelper (
157+ cv . elements . contentBody , naviEmbeded , 0 ,
158+ [ ] , [ ] ) ) != 0 ) {
159+ naviEmbeded . removeChild ( naviEmbeded . firstChild ) ;
160+ }
163161}
164-
162+
165163var listItems = naviEmbeded . getElementsByTagName ( "li" ) ;
166164var maxVisibleCount = 5 ;
167165for ( var i = 0 , loop = Math . min ( maxVisibleCount , listItems . length ) ; i < loop ; i ++ ) {