Media: Convert the attachments browser to use internal views. see #21390.

git-svn-id: https://develop.svn.wordpress.org/trunk@22804 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Daryl Koopersmith 2012-11-22 01:43:31 +00:00
parent a18c3758ce
commit d4be102ab2
1 changed files with 4 additions and 13 deletions

View File

@ -2192,7 +2192,7 @@
this.set( _.extend( {}, this._views, this.options.views ), { silent: true }); this.set( _.extend( {}, this._views, this.options.views ), { silent: true });
delete this.options.views; delete this.options.views;
// if ( ! this.options.silent ) if ( ! this.options.silent )
this.render(); this.render();
}, },
@ -2894,6 +2894,8 @@
controller: this.controller controller: this.controller
}); });
this.views.add( this.toolbar );
filters = this.options.filters; filters = this.options.filters;
if ( 'uploaded' === filters ) if ( 'uploaded' === filters )
FiltersConstructor = media.view.AttachmentFilters.Uploaded; FiltersConstructor = media.view.AttachmentFilters.Uploaded;
@ -2942,19 +2944,8 @@
// The single `Attachment` view to be used in the `Attachments` view. // The single `Attachment` view to be used in the `Attachments` view.
AttachmentView: this.options.AttachmentView AttachmentView: this.options.AttachmentView
}); });
},
dispose: function() { this.views.add( this.attachments );
this.toolbar.destroy();
this.attachments.destroy();
media.View.prototype.dispose.apply( this, arguments );
},
render: function() {
this.toolbar.$el.detach();
this.attachments.$el.detach();
this.$el.html([ this.toolbar.render().el, this.attachments.render().el ]);
return this;
} }
}); });