@@ -32,7 +32,9 @@ const setupTheme = () => {
3232 document . documentElement . classList . add ( 'dark-mode' ) ;
3333 }
3434
35- if ( ! themeToggleButton ) return ;
35+ if ( ! themeToggleButton ) {
36+ return ;
37+ }
3638
3739 themeToggleButton . hidden = false ;
3840
@@ -68,7 +70,9 @@ const setupTheme = () => {
6870 */
6971const setupPickers = ( ) => {
7072 const pickers = document . querySelectorAll ( '.picker-header > a' ) ;
71- if ( ! pickers . length ) return ;
73+ if ( ! pickers . length ) {
74+ return ;
75+ }
7276
7377 const closeAllPickers = ( ) => {
7478 pickers . forEach ( picker => {
@@ -81,7 +85,9 @@ const setupPickers = () => {
8185 } ;
8286
8387 const handleEscKey = e => {
84- if ( e . key === 'Escape' ) closeAllPickers ( ) ;
88+ if ( e . key === 'Escape' ) {
89+ closeAllPickers ( ) ;
90+ }
8591 } ;
8692
8793 pickers . forEach ( picker => {
@@ -90,7 +96,9 @@ const setupPickers = () => {
9096
9197 picker . addEventListener ( 'click' , e => {
9298 e . preventDefault ( ) ;
93- if ( picker . ariaExpanded === 'true' ) return ;
99+ if ( picker . ariaExpanded === 'true' ) {
100+ return ;
101+ }
94102
95103 requestAnimationFrame ( ( ) => {
96104 picker . ariaExpanded = true ;
@@ -108,7 +116,9 @@ const setupPickers = () => {
108116 */
109117const setupStickyHeaders = ( ) => {
110118 const header = document . querySelector ( '.header' ) ;
111- if ( ! header ) return ;
119+ if ( ! header ) {
120+ return ;
121+ }
112122
113123 let ignoreNextIntersection = false ;
114124
@@ -117,7 +127,9 @@ const setupStickyHeaders = () => {
117127 const currentPinned = header . classList . contains ( 'is-pinned' ) ;
118128 const shouldPin = entries [ 0 ] . intersectionRatio < 1 ;
119129
120- if ( currentPinned === shouldPin ) return ;
130+ if ( currentPinned === shouldPin ) {
131+ return ;
132+ }
121133 if ( ignoreNextIntersection ) {
122134 ignoreNextIntersection = false ;
123135 return ;
@@ -136,7 +148,9 @@ const setupStickyHeaders = () => {
136148 */
137149const setupAltDocsLink = ( ) => {
138150 const linkWrapper = document . getElementById ( 'alt-docs' ) ;
139- if ( ! linkWrapper ) return ;
151+ if ( ! linkWrapper ) {
152+ return ;
153+ }
140154
141155 const updateHashes = ( ) => {
142156 linkWrapper
@@ -153,7 +167,9 @@ const setupAltDocsLink = () => {
153167 */
154168const setupFlavorToggles = ( ) => {
155169 const toggles = document . querySelectorAll ( '.js-flavor-toggle' ) ;
156- if ( ! toggles . length ) return ;
170+ if ( ! toggles . length ) {
171+ return ;
172+ }
157173
158174 const isCustomFlavorEnabled = localStorage . getItem ( 'customFlavor' ) === 'true' ;
159175
@@ -220,4 +236,6 @@ function setupSidebarScroll() {
220236
221237// Initialize either on DOMContentLoaded or immediately if already loaded
222238document . addEventListener ( 'DOMContentLoaded' , initFeatures ) ;
223- if ( document . readyState !== 'loading' ) initFeatures ( ) ;
239+ if ( document . readyState !== 'loading' ) {
240+ initFeatures ( ) ;
241+ }
0 commit comments