Merge pull request #3776 from tobi-or-not-tobi/feature/shift-click-preview-link

Allow users to use meta keys when navigating to preview links
This commit is contained in:
Hakim El Hattab 2025-03-25 10:11:34 +01:00 committed by GitHub
commit ac4064b64d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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 );