Make WordPress Core

Changeset 22654


Ignore:
Timestamp:
11/19/2012 02:00:01 AM (12 years ago)
Author:
koopersmith
Message:

Media: Remove redundant sorting logic from composite models. see #21390.

File:
1 edited

Legend:

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

    r22597 r22654  
    748748                hasAttachment = !! this.getByCid( attachment.cid );
    749749
    750             if ( ! valid && hasAttachment ) {
     750            if ( ! valid && hasAttachment )
    751751                this.remove( attachment, options );
    752             } else if ( valid && ! hasAttachment ) {
     752            else if ( valid && ! hasAttachment )
    753753                this.add( attachment, options );
    754 
    755                 // If we haven't been silenced, resort the collection.
    756                 if ( this.comparator && ( ! options || ! options.silent ) )
    757                     this.sort({ silent: true });
    758             }
    759754
    760755            return this;
     
    770765            }, this );
    771766
    772             if ( this.comparator )
    773                 this.sort( options );
    774767            return this;
    775768        },
Note: See TracChangeset for help on using the changeset viewer.