Make WordPress Core

Changeset 22957


Ignore:
Timestamp:
11/30/2012 04:45:43 PM (12 years ago)
Author:
ryan
Message:

Resolve race conditions in Attachments.more().

Props koopersmith
fixes #22656

File:
1 edited

Legend:

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

    r22956 r22957  
    30723072        },
    30733073
     3074        removeContent: function() {
     3075            _.each(['attachments','uploader'], function( key ) {
     3076                if ( this[ key ] ) {
     3077                    this[ key ].remove();
     3078                    delete this[ key ];
     3079                }
     3080            }, this );
     3081        },
     3082
    30743083        createUploader: function() {
    3075             if ( this.attachments ) {
    3076                 this.attachments.remove();
    3077                 delete this.attachments;
    3078             }
     3084            this.removeContent();
    30793085
    30803086            this.uploader = new media.view.UploaderInline({
     
    30863092
    30873093        createAttachments: function() {
    3088             if ( this.uploader ) {
    3089                 this.uploader.remove();
    3090                 delete this.uploader;
    3091             }
     3094            this.removeContent();
    30923095
    30933096            this.attachments = new media.view.Attachments({
Note: See TracChangeset for help on using the changeset viewer.