File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ function setupStickyHeaders() {
118118 ) . observe ( header ) ;
119119}
120120
121- document . addEventListener ( 'DOMContentLoaded' , function ( ) {
121+ function bootstrap ( ) {
122122 // Check if we have JavaScript support
123123 document . querySelector ( ':root' ) . classList . add ( 'has-js' ) ;
124124
@@ -130,4 +130,10 @@ document.addEventListener('DOMContentLoaded', function() {
130130
131131 // Track when the header is in sticky position
132132 setupStickyHeaders ( ) ;
133- } , { once : true } ) ;
133+ }
134+
135+ if ( document . readyState === 'complete' ) {
136+ bootstrap ( ) ;
137+ } else {
138+ document . addEventListener ( 'DOMContentLoaded' , bootstrap , { once : true } ) ;
139+ }
Original file line number Diff line number Diff line change 99 < link rel ="stylesheet " href ="assets/style.css ">
1010 < link rel ="stylesheet " href ="assets/hljs.css ">
1111 < link rel ="canonical " href ="https://nodejs.org/api/__FILENAME__.html ">
12+ < script async defer src ="assets/api.js " type ="text/javascript "> </ script >
1213</ head >
1314< body class ="alt apidoc " id ="api-section-__FILENAME__ ">
1415 < div id ="content " class ="clearfix ">
@@ -74,6 +75,5 @@ <h1>Node.js __VERSION__ documentation</h1>
7475 </ div >
7576 </ div >
7677 </ div >
77- < script defer src ="assets/api.js " type ="text/javascript "> </ script >
7878</ body >
7979</ html >
You can’t perform that action at this time.
0 commit comments