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:
Ryan Boren 2012-11-30 16:45:43 +00:00
parent 59456a9cea
commit af42700ebd
1 changed files with 11 additions and 8 deletions

View File

@ -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,