Skip to content

Commit 1d641e7

Browse files
authored
Docs/Examples: Open panel on mobile when no page/example is selected (#32261)
1 parent dd134bf commit 1d641e7

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

docs/index.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1913,6 +1913,12 @@ <h2>Global</h2>
19131913

19141914
const selectedPage = window.location.hash.substring( 1 );
19151915

1916+
if ( selectedPage === '' ) {
1917+
1918+
panel.classList.add( 'open' );
1919+
1920+
}
1921+
19161922
const links = navigation.querySelectorAll( 'a' );
19171923

19181924
links.forEach( link => {

examples/index.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@ <h1><a href="https://threejs.org">three.js</a></h1>
110110

111111
}
112112

113+
if ( selected === null ) {
114+
115+
panel.classList.add( 'open' );
116+
117+
}
118+
113119
if ( viewer.src === '' ) {
114120

115121
viewer.srcdoc = document.getElementById( 'PlaceholderHTML' ).innerHTML;

utils/docs/template/static/index.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,12 @@ <h1><a href="https://threejs.org">three.js</a></h1>
188188

189189
const selectedPage = window.location.hash.substring( 1 );
190190

191+
if ( selectedPage === '' ) {
192+
193+
panel.classList.add( 'open' );
194+
195+
}
196+
191197
const links = navigation.querySelectorAll( 'a' );
192198

193199
links.forEach( link => {

0 commit comments

Comments
 (0)