mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
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:
@@ -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 );
|
||||
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user