Make WordPress Core

Changeset 22791


Ignore:
Timestamp:
11/21/2012 08:34:46 PM (14 years ago)
Author:
koopersmith
Message:

Media: Refresh the window-wide uploader whenever a state is activated. Properly unbind controller events. fixes #22504, see #21390.

File:
1 edited

Legend:

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

    r22790 r22791  
    938938                                this.collection.off( null, null, this );
    939939
     940                        // Unbind controller events.
     941                        if ( this.controller && this.controller.off )
     942                                this.controller.off( null, null, this );
     943
    940944                        // Recursively dispose child views.
    941945                        if ( this.views )
    … …  
    10451049                        if ( this.options.uploader ) {
    10461050                                this.uploader = new media.view.UploaderWindow({
     1051                                        controller: this,
    10471052                                        uploader: {
    10481053                                                dropzone:  this.modal ? this.modal.$el : this.$el,
    … …  
    17331738                        if ( uploader.dropzone && ! (uploader.dropzone instanceof $) )
    17341739                                uploader.dropzone = $( uploader.dropzone );
     1740
     1741                        this.controller.on( 'activate', this.refresh, this );
    17351742                },
    17361743
Note: See TracChangeset for help on using the changeset viewer.