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. git-svn-id: https://develop.svn.wordpress.org/trunk@37678 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
831a186108
commit
0d020faa68
|
@ -462,14 +462,14 @@ EditImage = wp.media.controller.State.extend({
|
||||||
* @since 3.9.0
|
* @since 3.9.0
|
||||||
*/
|
*/
|
||||||
activate: function() {
|
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
|
* @since 3.9.0
|
||||||
*/
|
*/
|
||||||
deactivate: function() {
|
deactivate: function() {
|
||||||
this.stopListening( this.frame );
|
this.frame.off( 'toolbar:render:edit-image' );
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -33,14 +33,14 @@ EditImage = wp.media.controller.State.extend({
|
||||||
* @since 3.9.0
|
* @since 3.9.0
|
||||||
*/
|
*/
|
||||||
activate: function() {
|
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
|
* @since 3.9.0
|
||||||
*/
|
*/
|
||||||
deactivate: function() {
|
deactivate: function() {
|
||||||
this.stopListening( this.frame );
|
this.frame.off( 'toolbar:render:edit-image' );
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue