From f80e93ebf843f4fa76c3e8c407efd69d433847a8 Mon Sep 17 00:00:00 2001 From: Daryl Koopersmith Date: Thu, 22 Nov 2012 01:43:31 +0000 Subject: [PATCH] Media: Convert the attachments browser to use internal views. see #21390. git-svn-id: http://core.svn.wordpress.org/trunk@22804 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/js/media-views.js | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/wp-includes/js/media-views.js b/wp-includes/js/media-views.js index d675a83b77..04a745deec 100644 --- a/wp-includes/js/media-views.js +++ b/wp-includes/js/media-views.js @@ -2192,7 +2192,7 @@ this.set( _.extend( {}, this._views, this.options.views ), { silent: true }); delete this.options.views; - // if ( ! this.options.silent ) + if ( ! this.options.silent ) this.render(); }, @@ -2894,6 +2894,8 @@ controller: this.controller }); + this.views.add( this.toolbar ); + filters = this.options.filters; if ( 'uploaded' === filters ) FiltersConstructor = media.view.AttachmentFilters.Uploaded; @@ -2942,19 +2944,8 @@ // The single `Attachment` view to be used in the `Attachments` view. AttachmentView: this.options.AttachmentView }); - }, - dispose: function() { - 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; + this.views.add( this.attachments ); } });