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].

Props adamsilverstein.
Fixes #36900.

git-svn-id: https://develop.svn.wordpress.org/trunk@37755 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Joe McGill 2016-06-21 13:34:19 +00:00
parent ce565d2fb2
commit b428df51e5
2 changed files with 4 additions and 4 deletions

View File

@ -4085,8 +4085,8 @@ AttachmentsBrowser = View.extend({
});
// Add keydown listener to the instance of the Attachments view
this.attachments.listenTo( this.controller, 'attachment:keydown:arrow', this.attachments.arrowEvent );
this.attachments.listenTo( this.controller, 'attachment:details:shift-tab', this.attachments.restoreFocus );
this.controller.on( 'attachment:keydown:arrow', _.bind( this.attachments.arrowEvent, this.attachments ) );
this.controller.on( 'attachment:details:shift-tab', _.bind( this.attachments.restoreFocus, this.attachments ) );
this.views.add( this.attachments );

View File

@ -354,8 +354,8 @@ AttachmentsBrowser = View.extend({
});
// Add keydown listener to the instance of the Attachments view
this.attachments.listenTo( this.controller, 'attachment:keydown:arrow', this.attachments.arrowEvent );
this.attachments.listenTo( this.controller, 'attachment:details:shift-tab', this.attachments.restoreFocus );
this.controller.on( 'attachment:keydown:arrow', _.bind( this.attachments.arrowEvent, this.attachments ) );
this.controller.on( 'attachment:details:shift-tab', _.bind( this.attachments.restoreFocus, this.attachments ) );
this.views.add( this.attachments );