Make WordPress Core

Changeset 29584


Ignore:
Timestamp:
08/24/2014 04:42:14 PM (11 years ago)
Author:
wonderboymusic
Message:

Media Grid: restore focus to the selected item when shift-tab away from the attachment details sidebar.

Fixes #29303.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/media-views.js

    r29582 r29584  
    52795279        },
    52805280
     5281        restoreFocus: function() {
     5282            this.$( 'li.selected:first' ).focus();
     5283        },
     5284
    52815285        arrowEvent: function( event ) {
    52825286            var attachments = this.$el.children( 'li' ),
     
    60066010
    60076011            // Add keydown listener to the instance of the Attachments view
    6008             this.attachments.listenTo( this.controller, 'attachment:keydown:arrow', this.attachments.arrowEvent );
     6012            this.attachments.listenTo( this.controller, 'attachment:keydown:arrow',     this.attachments.arrowEvent );
     6013            this.attachments.listenTo( this.controller, 'attachment:details:shift-tab', this.attachments.restoreFocus );
    60096014
    60106015            this.views.add( this.attachments );
     
    65836588        toggleSelectionHandler: function( event ) {
    65846589            if ( 'keydown' === event.type && 9 === event.keyCode && event.shiftKey && event.target === this.$( ':tabbable' ).get( 0 ) ) {
    6585                 this.$( ':tabbable' ).eq( 0 ).blur();
     6590                this.controller.trigger( 'attachment:details:shift-tab', event );
    65866591                return false;
    65876592            }
Note: See TracChangeset for help on using the changeset viewer.