Kaynağa Gözat

Docs/Examples: Open panel on mobile when no page/example is selected (#32261)

mrdoob 1 ay önce
ebeveyn
işleme
1d641e759b

+ 6 - 0
docs/index.html

@@ -1913,6 +1913,12 @@
 
 			const selectedPage = window.location.hash.substring( 1 );
 
+			if ( selectedPage === '' ) {
+
+				panel.classList.add( 'open' );
+
+			}
+
 			const links = navigation.querySelectorAll( 'a' );
 
 			links.forEach( link => {

+ 6 - 0
examples/index.html

@@ -110,6 +110,12 @@
 
 			}
 
+			if ( selected === null ) {
+
+				panel.classList.add( 'open' );
+
+			}
+
 			if ( viewer.src === '' ) {
 
 				viewer.srcdoc = document.getElementById( 'PlaceholderHTML' ).innerHTML;

+ 6 - 0
utils/docs/template/static/index.html

@@ -188,6 +188,12 @@
 
 			const selectedPage = window.location.hash.substring( 1 );
 
+			if ( selectedPage === '' ) {
+
+				panel.classList.add( 'open' );
+
+			}
+
 			const links = navigation.querySelectorAll( 'a' );
 
 			links.forEach( link => {

粤ICP备19079148号