From 3858c09d02c75fb44416e263d0edab4989a3b1ca Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Wed, 16 Mar 2016 02:47:29 +0000 Subject: [PATCH] Editor: fix exiting DFW with the keyboard shortcut on Mac (Opt+Ctrl+W). Fixes #36222. git-svn-id: https://develop.svn.wordpress.org/trunk@37003 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/editor-expand.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/js/editor-expand.js b/src/wp-admin/js/editor-expand.js index e03b3f572e..ba5b095203 100644 --- a/src/wp-admin/js/editor-expand.js +++ b/src/wp-admin/js/editor-expand.js @@ -887,10 +887,15 @@ } 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; }