Media: Remove redundant code.

Make the composite gallery library use `mirror` instead of `observe`, as one method now invokes the other. Also, make `mirror` return the attachment collection for chaining.

see #21390.


git-svn-id: http://core.svn.wordpress.org/trunk@22750 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Daryl Koopersmith 2012-11-21 12:11:38 +00:00
parent 96576a2dca
commit 5e39581c13
2 changed files with 3 additions and 6 deletions

View File

@ -434,6 +434,8 @@ window.wp = window.wp || {};
// when `observe()` calls `validateAll()`.
this.reset( [], { silent: true } );
this.observe( attachments );
return this;
},
unmirror: function() {

View File

@ -403,12 +403,7 @@
return !! original.getByCid( attachment.cid ) && ! exclude.getByCid( attachment.cid );
};
composite.observe( original ).observe( exclude );
// When `more()` is triggered on the composite collection,
// pass the command over to the `original`, which will
// populate the query.
composite.more = _.bind( original.more, original );
composite.mirror( original ).observe( exclude );
this.set( 'library', composite );
},