From 353bfb5e7a20aa9ba0c60f0963d2d48f2393b6cd Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Fri, 15 Mar 2019 21:42:48 +0000 Subject: [PATCH] TinyMCE: fix the TinyMCE help modal keyboard shortcut on Mac for the classic editor and classic block. Fixes #45791. git-svn-id: https://develop.svn.wordpress.org/trunk@44913 602fd350-edb4-49c9-b593-d223f7449a82 --- .../vendor/tinymce/plugins/wordpress/plugin.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/js/_enqueues/vendor/tinymce/plugins/wordpress/plugin.js b/src/js/_enqueues/vendor/tinymce/plugins/wordpress/plugin.js index 95d462d115..790fad6265 100644 --- a/src/js/_enqueues/vendor/tinymce/plugins/wordpress/plugin.js +++ b/src/js/_enqueues/vendor/tinymce/plugins/wordpress/plugin.js @@ -679,7 +679,15 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) { // Workaround for not triggering the global help modal in the Block Editor by the Classic Block shortcut. editor.on( 'keydown', function( event ) { - if ( event.shiftKey && event.altKey && event.code === 'KeyH' ) { + var match; + + if ( tinymce.Env.mac ) { + match = event.ctrlKey && event.altKey && event.code === 'KeyH'; + } else { + match = event.shiftKey && event.altKey && event.code === 'KeyH'; + } + + if ( match ) { editor.execCommand( 'WP_Help' ); event.stopPropagation(); event.stopImmediatePropagation();