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
This commit is contained in:
Andrew Ozz 2019-03-15 21:42:48 +00:00
parent 02d3de004c
commit 353bfb5e7a
1 changed files with 9 additions and 1 deletions

View File

@ -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();