WordPress.org

Make WordPress Core

Changeset 37813


Ignore:
Timestamp:
06/21/2016 02:54:22 PM (4 years ago)
Author:
swissspidy
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].

Merge of [37678] to the 4.5 branch.

Props adamsilverstein.
Fixes #36861.

Location:
branches/4.5
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/4.5

  • branches/4.5/src/wp-includes/js/media-views.js

    r37804 r37813  
    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
  • branches/4.5/src/wp-includes/js/media/controllers/edit-image.js

    r33337 r37813  
    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.