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:
parent
9f5eb3c604
commit
e7a6236168
@ -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 ) {
|
||||
|
@ -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 ) {
|
||||
|
Loading…
Reference in New Issue
Block a user