From b0cfcbb5678a03de1d5d5debfa93bfc330ce293a Mon Sep 17 00:00:00 2001 From: Adam Silverstein Date: Fri, 13 Oct 2017 18:20:37 +0000 Subject: [PATCH] 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 --- src/wp-includes/js/media-grid.js | 2 -- src/wp-includes/js/media/views/frame/edit-attachments.js | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/wp-includes/js/media-grid.js b/src/wp-includes/js/media-grid.js index c9babd6d50..09145eeade 100644 --- a/src/wp-includes/js/media-grid.js +++ b/src/wp-includes/js/media-grid.js @@ -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 ) ); diff --git a/src/wp-includes/js/media/views/frame/edit-attachments.js b/src/wp-includes/js/media/views/frame/edit-attachments.js index 0f0606eb02..469f5db739 100644 --- a/src/wp-includes/js/media/views/frame/edit-attachments.js +++ b/src/wp-includes/js/media/views/frame/edit-attachments.js @@ -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 ) );