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

git-svn-id: http://core.svn.wordpress.org/trunk@22654 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Daryl Koopersmith 2012-11-19 02:00:01 +00:00
parent 97032e08aa
commit 88f09f7118

View File

@ -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;
},