Media Library: After [36546] restore the "Add new" functionality.

Rework handling of the `'toggle:upload:attachment'` event using `.on` vs `.listenTo` for better compatibility with the current version of Backbone.

Props adamsilverstein.
See #34350.
Fixes #35853.

git-svn-id: https://develop.svn.wordpress.org/trunk@36575 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling (ocean90) 2016-02-18 17:49:21 +00:00
parent 9f5eb3c604
commit e7a6236168
2 changed files with 2 additions and 2 deletions

View File

@ -3754,7 +3754,7 @@ AttachmentsBrowser = View.extend({
AttachmentView: wp.media.view.Attachment.Library
});
this.listenTo( this.controller, 'toggle:upload:attachment', _.bind( this.toggleUploader, this ) );
this.controller.on( 'toggle:upload:attachment', this.toggleUploader, this );
this.controller.on( 'edit:selection', this.editSelection );
this.createToolbar();
if ( this.options.sidebar ) {

View File

@ -38,7 +38,7 @@ AttachmentsBrowser = View.extend({
AttachmentView: wp.media.view.Attachment.Library
});
this.listenTo( this.controller, 'toggle:upload:attachment', _.bind( this.toggleUploader, this ) );
this.controller.on( 'toggle:upload:attachment', this.toggleUploader, this );
this.controller.on( 'edit:selection', this.editSelection );
this.createToolbar();
if ( this.options.sidebar ) {