diff --git a/src/wp-includes/js/media-views.js b/src/wp-includes/js/media-views.js index 596e4b0ba3..e8a8202d59 100644 --- a/src/wp-includes/js/media-views.js +++ b/src/wp-includes/js/media-views.js @@ -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 ); diff --git a/src/wp-includes/js/media/views/attachments/browser.js b/src/wp-includes/js/media/views/attachments/browser.js index 819d251b3c..bd83278afc 100644 --- a/src/wp-includes/js/media/views/attachments/browser.js +++ b/src/wp-includes/js/media/views/attachments/browser.js @@ -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 );