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:
parent
faeac43629
commit
b0cfcbb567
@ -795,7 +795,6 @@ EditAttachments = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.EditAtta
|
|||||||
*/
|
*/
|
||||||
previousMediaItem: function() {
|
previousMediaItem: function() {
|
||||||
if ( ! this.hasPrevious() ) {
|
if ( ! this.hasPrevious() ) {
|
||||||
this.$( '.left' ).blur();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.trigger( 'refresh', this.library.at( this.getCurrentIndex() - 1 ) );
|
this.trigger( 'refresh', this.library.at( this.getCurrentIndex() - 1 ) );
|
||||||
@ -807,7 +806,6 @@ EditAttachments = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.EditAtta
|
|||||||
*/
|
*/
|
||||||
nextMediaItem: function() {
|
nextMediaItem: function() {
|
||||||
if ( ! this.hasNext() ) {
|
if ( ! this.hasNext() ) {
|
||||||
this.$( '.right' ).blur();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.trigger( 'refresh', this.library.at( this.getCurrentIndex() + 1 ) );
|
this.trigger( 'refresh', this.library.at( this.getCurrentIndex() + 1 ) );
|
||||||
|
@ -201,7 +201,6 @@ EditAttachments = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.EditAtta
|
|||||||
*/
|
*/
|
||||||
previousMediaItem: function() {
|
previousMediaItem: function() {
|
||||||
if ( ! this.hasPrevious() ) {
|
if ( ! this.hasPrevious() ) {
|
||||||
this.$( '.left' ).blur();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.trigger( 'refresh', this.library.at( this.getCurrentIndex() - 1 ) );
|
this.trigger( 'refresh', this.library.at( this.getCurrentIndex() - 1 ) );
|
||||||
@ -213,7 +212,6 @@ EditAttachments = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.EditAtta
|
|||||||
*/
|
*/
|
||||||
nextMediaItem: function() {
|
nextMediaItem: function() {
|
||||||
if ( ! this.hasNext() ) {
|
if ( ! this.hasNext() ) {
|
||||||
this.$( '.right' ).blur();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.trigger( 'refresh', this.library.at( this.getCurrentIndex() + 1 ) );
|
this.trigger( 'refresh', this.library.at( this.getCurrentIndex() + 1 ) );
|
||||||
|
Loading…
Reference in New Issue
Block a user