瀏覽代碼

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
Hakim El Hattab 1 月之前
父節點
當前提交
ac4064b64d
共有 5 個文件被更改,包括 4 次插入0 次删除
  1. 0 0
      dist/reveal.esm.js
  2. 0 0
      dist/reveal.esm.js.map
  3. 0 0
      dist/reveal.js
  4. 0 0
      dist/reveal.js.map
  5. 4 0
      js/controllers/overlay.js

文件差異過大導致無法顯示
+ 0 - 0
dist/reveal.esm.js


文件差異過大導致無法顯示
+ 0 - 0
dist/reveal.esm.js.map


文件差異過大導致無法顯示
+ 0 - 0
dist/reveal.js


文件差異過大導致無法顯示
+ 0 - 0
dist/reveal.js.map


+ 4 - 0
js/controllers/overlay.js

@@ -284,6 +284,10 @@ export default class Overlay {
 
 		// Was a link preview clicked?
 		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' );
 			if( url ) {
 				this.showIframePreview( url );

部分文件因文件數量過多而無法顯示