Media: Remove redundant sorting logic from composite models. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22654 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
34985fbc7a
commit
5c2e5e3231
|
@ -747,16 +747,11 @@ window.wp = window.wp || {};
|
|||
var valid = this.validator( attachment ),
|
||||
hasAttachment = !! this.getByCid( attachment.cid );
|
||||
|
||||
if ( ! valid && hasAttachment ) {
|
||||
if ( ! valid && hasAttachment )
|
||||
this.remove( attachment, options );
|
||||
} else if ( valid && ! hasAttachment ) {
|
||||
else if ( valid && ! hasAttachment )
|
||||
this.add( attachment, options );
|
||||
|
||||
// If we haven't been silenced, resort the collection.
|
||||
if ( this.comparator && ( ! options || ! options.silent ) )
|
||||
this.sort({ silent: true });
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
|
@ -769,8 +764,6 @@ window.wp = window.wp || {};
|
|||
this.evaluate( attachment, { silent: true });
|
||||
}, this );
|
||||
|
||||
if ( this.comparator )
|
||||
this.sort( options );
|
||||
return this;
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue