Resolve race conditions in Attachments.more().
Props koopersmith fixes #22656 git-svn-id: http://core.svn.wordpress.org/trunk@22957 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
59456a9cea
commit
af42700ebd
|
@ -3071,11 +3071,17 @@
|
|||
}
|
||||
},
|
||||
|
||||
createUploader: function() {
|
||||
if ( this.attachments ) {
|
||||
this.attachments.remove();
|
||||
delete this.attachments;
|
||||
removeContent: function() {
|
||||
_.each(['attachments','uploader'], function( key ) {
|
||||
if ( this[ key ] ) {
|
||||
this[ key ].remove();
|
||||
delete this[ key ];
|
||||
}
|
||||
}, this );
|
||||
},
|
||||
|
||||
createUploader: function() {
|
||||
this.removeContent();
|
||||
|
||||
this.uploader = new media.view.UploaderInline({
|
||||
controller: this.controller
|
||||
|
@ -3085,10 +3091,7 @@
|
|||
},
|
||||
|
||||
createAttachments: function() {
|
||||
if ( this.uploader ) {
|
||||
this.uploader.remove();
|
||||
delete this.uploader;
|
||||
}
|
||||
this.removeContent();
|
||||
|
||||
this.attachments = new media.view.Attachments({
|
||||
controller: this.controller,
|
||||
|
|
Loading…
Reference in New Issue