Skip to content

Commit af9bfe1

Browse files
authored
Merge pull request #14544 from greggman/no-cmd-click-navigation
Prevent navigation if modifiers pressed.
2 parents e19ca16 + 0ab965e commit af9bfe1

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

docs/index.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,12 @@ <h1><a href="http://threejs.org">three.js</a> / docs</h1>
9393
link.setAttribute( 'target', 'viewer' );
9494
link.addEventListener( 'click', function ( event ) {
9595

96-
window.location.hash = pageURL;
97-
panel.classList.add( 'collapsed' );
96+
if ( event.button === 0 && !event.ctrlKey && !event.altKey && !event.metaKey ) {
97+
98+
window.location.hash = pageURL;
99+
panel.classList.add( 'collapsed' );
100+
101+
}
98102

99103
} );
100104

examples/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ <h1><a href="http://threejs.org">three.js</a> / examples</h1>
296296
link.setAttribute( 'target', 'viewer' );
297297
link.addEventListener( 'click', function ( event ) {
298298

299-
if ( event.button === 0 ) {
299+
if ( event.button === 0 && !event.ctrlKey && !event.altKey && !event.metaKey ) {
300300

301301
selectFile( file );
302302

0 commit comments

Comments
 (0)