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].

Props adamsilverstein.
Fixes #36861 for trunk.
Built from https://develop.svn.wordpress.org/trunk@37678


git-svn-id: http://core.svn.wordpress.org/trunk@37644 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Joe McGill 2016-06-10 21:12:29 +00:00
parent 2600c28169
commit bd3c735c6e
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.6-alpha-37677';
$wp_version = '4.6-alpha-37678';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.