1
0
mirror of https://github.com/hakimel/reveal.js.git synced 2025-08-05 14:17:56 +02:00

Allow users to use meta keys when navigating to preview links

This commit is contained in:
tobi-or-not-tobi
2025-03-25 08:29:03 +01:00
parent 5c77e86301
commit 9f7256fe78
5 changed files with 8 additions and 4 deletions

2
dist/reveal.esm.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
dist/reveal.js vendored

File diff suppressed because one or more lines are too long

2
dist/reveal.js.map vendored

File diff suppressed because one or more lines are too long

View File

@@ -284,6 +284,10 @@ export default class Overlay {
// Was a link preview clicked? // Was a link preview clicked?
if( linkTarget ) { if( linkTarget ) {
if (event.metaKey || event.shiftKey || event.altKey) {
// Let the browser handle meta keys naturally so users can cmd+click, cmd+shift+click, shift+click, alt+click, etc.
return;
}
let url = linkTarget.getAttribute( 'href' ) || linkTarget.getAttribute( 'data-preview-link' ); let url = linkTarget.getAttribute( 'href' ) || linkTarget.getAttribute( 'data-preview-link' );
if( url ) { if( url ) {
this.showIframePreview( url ); this.showIframePreview( url );