Media: Fix rendering of incorrect toolbar in the Edit view.

This switches event binding in `wp.media.controller.EditImage` to use `on`
instead of `listenTo` to restore rendering of the correct toolbar when the
`toolbar:render:edit-image` event fires. The existing listeners broke
when we upgraded Backbone in [36546].

Merge of [37678] to the 4.5 branch.

Props adamsilverstein.
Fixes #36861.
Built from https://develop.svn.wordpress.org/branches/4.5@37813


git-svn-id: http://core.svn.wordpress.org/branches/4.5@37778 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Pascal Birchler 2016-06-21 14:55:30 +00:00
parent b747172c20
commit 47e67b7d33
3 changed files with 4 additions and 4 deletions

View File

@ -462,14 +462,14 @@ EditImage = wp.media.controller.State.extend({
* @since 3.9.0
*/
activate: function() {
this.listenTo( this.frame, 'toolbar:render:edit-image', this.toolbar );
this.frame.on( 'toolbar:render:edit-image', _.bind( this.toolbar, this ) );
},
/**
* @since 3.9.0
*/
deactivate: function() {
this.stopListening( this.frame );
this.frame.off( 'toolbar:render:edit-image' );
},
/**

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.5.3-alpha-37809';
$wp_version = '4.5.3-alpha-37813';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.