]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/js/wp-fullscreen.js
WordPress 4.1-scripts
[autoinstalls/wordpress.git] / wp-admin / js / wp-fullscreen.js
index 6ce373e3917fc4904edb2c82b0d92c80f5fe9f65..2431738b605ff8654061fecc3bee5a8cbd062db9 100644 (file)
@@ -1,6 +1,6 @@
 /* global deleteUserSetting, setUserSetting, switchEditors, tinymce, tinyMCEPreInit */
 /**
- * Distraction Free Writing
+ * Distraction-Free Writing
  * (wp-fullscreen)
  *
  * Access the API globally using the window.wp.editor.fullscreen variable.
                                }
                        });
 
-                       $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();
                                }