Make WordPress Core

Ticket #28279: esc.patch

File esc.patch, 1.3 KB (added by iseulde, 12 years ago)
  • src/wp-admin/js/wp-fullscreen.js

     
    510510                                }
    511511                        });
    512512
    513                         $document.on( 'keydown.wp-fullscreen', function( event ) {
    514                                 if ( 27 === event.which && s.visible ) { // Esc
     513                        $( window ).on( 'keyup', function( event ) {
     514                                // Turn fullscreen off when esc is pressed.
     515                                if ( 27 === event.keyCode && s.visible ) {
    515516                                        api.off();
    516                                         event.stopImmediatePropagation();
    517517                                }
    518518                        });
    519519
  • src/wp-includes/js/tinymce/plugins/wpfullscreen/plugin.js

     
    7878
    7979        editor.addCommand( 'wpFullScreen', toggleFullscreen );
    8080
     81        editor.on( 'keyup', function( event ) {
     82                // Turn fullscreen off when esc is pressed.
     83                if ( event.keyCode === 27 && wp.editor.fullscreen.settings.visible ) {
     84                        wp.editor.fullscreen.off();
     85                }
     86        } );
     87
    8188        editor.on( 'init', function() {
    8289                // Set the editor when initializing from whitin DFW
    8390                if ( editor.getParam('wp_fullscreen') ) {