In the Edit Attachment frame, when in Edit Image mode, add a key event for Escape. There are conflicting `keydown` handlers that don't propagate the event to the modal properly.

Fixes #29121.

Built from https://develop.svn.wordpress.org/trunk@29481


git-svn-id: http://core.svn.wordpress.org/trunk@29259 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-08-13 18:15:18 +00:00
parent 2943f5384c
commit ca03604712
2 changed files with 9 additions and 3 deletions

View File

@ -492,12 +492,18 @@
if ( $target.is( 'input' ) || $target.is( 'textarea' ) ) {
return event;
}
// Escape key, while in the Edit Image mode
if ( 27 === event.keyCode ) {
this.modal.close();
}
// The right arrow key
if ( event.keyCode === 39 ) {
if ( 39 === event.keyCode ) {
this.nextMediaItem();
}
// The left arrow key
if ( event.keyCode === 37 ) {
if ( 37 === event.keyCode ) {
this.previousMediaItem();
}
},

File diff suppressed because one or more lines are too long