Mr.doob 7 år sedan
förälder
incheckning
6b0a67c06e
2 ändrade filer med 5 tillägg och 9 borttagningar
  1. 3 5
      docs/index.html
  2. 2 4
      examples/index.html

+ 3 - 5
docs/index.html

@@ -93,12 +93,10 @@
 				link.setAttribute( 'target', 'viewer' );
 				link.addEventListener( 'click', function ( event ) {
 
-					if ( event.button === 0 && !event.ctrlKey && !event.altKey && !event.metaKey ) {
+					if ( event.button !== 0 || event.ctrlKey || event.altKey || event.metaKey ) return;
 
-						window.location.hash = pageURL;
-						panel.classList.add( 'collapsed' );
-
-					}
+					window.location.hash = pageURL;
+					panel.classList.add( 'collapsed' );
 
 				} );
 

+ 2 - 4
examples/index.html

@@ -296,11 +296,9 @@
 			link.setAttribute( 'target', 'viewer' );
 			link.addEventListener( 'click', function ( event ) {
 
-				if ( event.button === 0 && !event.ctrlKey && !event.altKey && !event.metaKey ) {
+				if ( event.button !== 0 || event.ctrlKey || event.altKey || event.metaKey ) return;
 
-					selectFile( file );
-
-				}
+				selectFile( file );
 
 			} );