]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/js/wp-fullscreen.js
WordPress 4.0
[autoinstalls/wordpress.git] / wp-admin / js / wp-fullscreen.js
index 6ce373e3917fc4904edb2c82b0d92c80f5fe9f65..de73060ae5e912187c46f89d40f4fd07267102e1 100644 (file)
                                }
                        });
 
-                       $document.on( 'keydown.wp-fullscreen', function( event ) {
-                               if ( 27 === event.which && s.visible ) { // Esc
+                       $( window ).on( 'keydown.wp-fullscreen', function( event ) {
+                               // Turn fullscreen off when Esc is pressed.
+                               if ( 27 === event.keyCode && s.visible ) {
                                        api.off();
                                        event.stopImmediatePropagation();
                                }