WordPress.org

Make WordPress Core

Changeset 22750


Ignore:
Timestamp:
11/21/2012 12:11:38 PM (8 years ago)
Author:
koopersmith
Message:

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.

Location:
trunk/wp-includes/js
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/js/media-models.js

    r22746 r22750  
    435435            this.reset( [], { silent: true } );
    436436            this.observe( attachments );
     437
     438            return this;
    437439        },
    438440
  • trunk/wp-includes/js/media-views.js

    r22745 r22750  
    404404            };
    405405
    406             composite.observe( original ).observe( exclude );
    407 
    408             // When `more()` is triggered on the composite collection,
    409             // pass the command over to the `original`, which will
    410             // populate the query.
    411             composite.more = _.bind( original.more, original );
     406            composite.mirror( original ).observe( exclude );
    412407
    413408            this.set( 'library', composite );
Note: See TracChangeset for help on using the changeset viewer.