Make WordPress Core

Changeset 37804


Ignore:
Timestamp:
06/21/2016 02:48:13 PM (7 years ago)
Author:
swissspidy
Message:

Media: Restore keyboard navigation of the media grid.

This changes the binding of event listeners in the Attachments Browser
to use on instead of listenTo for the attachment:keydown:arrow and
attachment:details:shift-tab events. The existing listeners broke
when we upgraded Backbone in [36546].

Merge of [37755] to the 4.5 branch.

Props adamsilverstein.
Fixes #36900.

Location:
branches/4.5
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/4.5

  • branches/4.5/src/wp-includes/js/media-views.js

    r37113 r37804  
    40864086
    40874087        // Add keydown listener to the instance of the Attachments view
    4088         this.attachments.listenTo( this.controller, 'attachment:keydown:arrow',     this.attachments.arrowEvent );
    4089         this.attachments.listenTo( this.controller, 'attachment:details:shift-tab', this.attachments.restoreFocus );
     4088        this.controller.on( 'attachment:keydown:arrow',     _.bind( this.attachments.arrowEvent, this.attachments ) );
     4089        this.controller.on( 'attachment:details:shift-tab', _.bind( this.attachments.restoreFocus, this.attachments ) );
    40904090
    40914091        this.views.add( this.attachments );
  • branches/4.5/src/wp-includes/js/media/views/attachments/browser.js

    r36575 r37804  
    355355
    356356        // Add keydown listener to the instance of the Attachments view
    357         this.attachments.listenTo( this.controller, 'attachment:keydown:arrow',     this.attachments.arrowEvent );
    358         this.attachments.listenTo( this.controller, 'attachment:details:shift-tab', this.attachments.restoreFocus );
     357        this.controller.on( 'attachment:keydown:arrow',     _.bind( this.attachments.arrowEvent, this.attachments ) );
     358        this.controller.on( 'attachment:details:shift-tab', _.bind( this.attachments.restoreFocus, this.attachments ) );
    359359
    360360        this.views.add( this.attachments );
Note: See TracChangeset for help on using the changeset viewer.