Media Grid: Fix escape key sometimes failing to close details modal.

Fix an issue where the escape key would no longer close the attachment details modal after attempting to navigate over the navigation boundaries (by clicking the left arrow key on the first media item or clicking the right arrow key on the last media item). Remove a focus blur which caused the underlying Backbone View to not receive the 'keydown' event.

Props subrataemfluence, afercia.
Fixes #42180.


git-svn-id: https://develop.svn.wordpress.org/trunk@41856 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Adam Silverstein 2017-10-13 18:20:37 +00:00
parent faeac43629
commit b0cfcbb567
2 changed files with 0 additions and 4 deletions

View File

@ -795,7 +795,6 @@ EditAttachments = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.EditAtta
*/
previousMediaItem: function() {
if ( ! this.hasPrevious() ) {
this.$( '.left' ).blur();
return;
}
this.trigger( 'refresh', this.library.at( this.getCurrentIndex() - 1 ) );
@ -807,7 +806,6 @@ EditAttachments = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.EditAtta
*/
nextMediaItem: function() {
if ( ! this.hasNext() ) {
this.$( '.right' ).blur();
return;
}
this.trigger( 'refresh', this.library.at( this.getCurrentIndex() + 1 ) );

View File

@ -201,7 +201,6 @@ EditAttachments = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.EditAtta
*/
previousMediaItem: function() {
if ( ! this.hasPrevious() ) {
this.$( '.left' ).blur();
return;
}
this.trigger( 'refresh', this.library.at( this.getCurrentIndex() - 1 ) );
@ -213,7 +212,6 @@ EditAttachments = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.EditAtta
*/
nextMediaItem: function() {
if ( ! this.hasNext() ) {
this.$( '.right' ).blur();
return;
}
this.trigger( 'refresh', this.library.at( this.getCurrentIndex() + 1 ) );