Ticket #30528: 30528.2.diff
File 30528.2.diff, 1.4 KB (added by , 10 years ago) |
---|
-
src/wp-admin/js/editor-expand.js
876 876 877 877 // fadeIn and return on Escape and keyboard shortcut Alt+Shift+W. 878 878 if ( key === 27 || ( key === 87 && event.altKey && event.shiftKey ) ) { 879 fadeIn( );879 fadeIn( event ); 880 880 return; 881 881 } 882 882 … … 994 994 fadeOutSlug(); 995 995 } 996 996 997 function fadeIn() { 997 function fadeIn( event ) { 998 998 999 if ( faded ) { 999 1000 faded = false; 1000 1001 … … 1008 1009 1009 1010 $overlay.off( 'mouseenter.focus mouseleave.focus mousemove.focus touchstart.focus' ); 1010 1011 1011 $editor.on( 'mouseenter.focus', function() { 1012 if ( $.contains( $editor.get( 0 ), document.activeElement ) || editorHasFocus ) { 1013 fadeOut(); 1014 } 1015 } ); 1012 /* 1013 * When fading in, temporarily watch for refocus and fade back out - helps 1014 * with 'accidental' editor exits with the mouse. When fading in and the event 1015 * is a key event (Escape or Alt+Shift+W) don't watch for refocus. 1016 */ 1017 if ( 'undefined' === typeof event ) { 1018 $editor.on( 'mouseenter.focus', function() { 1019 if ( $.contains( $editor.get( 0 ), document.activeElement ) || editorHasFocus ) { 1020 fadeOut(); 1021 } 1022 } ); 1023 } 1016 1024 1017 1025 focusLostTimer = setTimeout( function() { 1018 1026 focusLostTimer = null;