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.


git-svn-id: https://develop.svn.wordpress.org/trunk@29481 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2014-08-13 18:14:15 +00:00
parent 4958fecdaf
commit d48bee596a
1 changed files with 8 additions and 2 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();
}
},