Make WordPress Core

Changeset 37678


Ignore:
Timestamp:
06/10/2016 09:11:28 PM (9 years ago)
Author:
joemcgill
Message:

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.

Location:
trunk/src/wp-includes/js
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/media-views.js

    r37610 r37678  
    463463     */
    464464    activate: function() {
    465         this.listenTo( this.frame, 'toolbar:render:edit-image', this.toolbar );
     465        this.frame.on( 'toolbar:render:edit-image', _.bind( this.toolbar, this ) );
    466466    },
    467467
     
    470470     */
    471471    deactivate: function() {
    472         this.stopListening( this.frame );
     472        this.frame.off( 'toolbar:render:edit-image' );
    473473    },
    474474
  • trunk/src/wp-includes/js/media/controllers/edit-image.js

    r33337 r37678  
    3434     */
    3535    activate: function() {
    36         this.listenTo( this.frame, 'toolbar:render:edit-image', this.toolbar );
     36        this.frame.on( 'toolbar:render:edit-image', _.bind( this.toolbar, this ) );
    3737    },
    3838
     
    4141     */
    4242    deactivate: function() {
    43         this.stopListening( this.frame );
     43        this.frame.off( 'toolbar:render:edit-image' );
    4444    },
    4545
Note: See TracChangeset for help on using the changeset viewer.