}
function fadeOut( event ) {
- var key = event && event.keyCode;
+ var isMac,
+ key = event && event.keyCode;
- // fadeIn and return on Escape and keyboard shortcut Alt+Shift+W.
- if ( key === 27 || ( key === 87 && event.altKey && event.shiftKey ) ) {
+ if ( window.navigator.platform ) {
+ isMac = ( window.navigator.platform.indexOf( 'Mac' ) > -1 );
+ }
+
+ // fadeIn and return on Escape and keyboard shortcut Alt+Shift+W and Ctrl+Opt+W.
+ if ( key === 27 || ( key === 87 && event.altKey && ( ( ! isMac && event.shiftKey ) || ( isMac && event.ctrlKey ) ) ) ) {
fadeIn( event );
return;
}
} );
editor.addCommand( 'wpToggleDFW', toggle );
- editor.addShortcut( 'alt+shift+w', '', 'wpToggleDFW' );
+ editor.addShortcut( 'access+w', '', 'wpToggleDFW' );
} );
$document.on( 'tinymce-editor-init.focus', function( event, editor ) {
$document.on( 'dfw-on.focus', mceBind ).on( 'dfw-off.focus', mceUnbind );
// Make sure the body focuses when clicking outside it.
- editor.on( 'click', function( event ) {
+ editor.on( 'click', function( event ) {
if ( event.target === editor.getDoc().documentElement ) {
editor.focus();
}