DFW: Properly handle Esc key when the content is focused or when switching browser tabs.

props avryl.
fixes #28279.
Built from https://develop.svn.wordpress.org/trunk@28443


git-svn-id: http://core.svn.wordpress.org/trunk@28270 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov
2014-05-16 10:43:14 +00:00
parent d970ac80c6
commit abc830ca9d
5 changed files with 12 additions and 5 deletions

View File

@@ -510,10 +510,10 @@
}
});
$document.on( 'keydown.wp-fullscreen', function( event ) {
if ( 27 === event.which && s.visible ) { // Esc
$( window ).on( 'keyup', function( event ) {
// Turn fullscreen off when Esc is pressed.
if ( 27 === event.keyCode && s.visible ) {
api.off();
event.stopImmediatePropagation();
}
});

File diff suppressed because one or more lines are too long