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:
parent
97032e08aa
commit
88f09f7118
|
@ -747,16 +747,11 @@ window.wp = window.wp || {};
|
||||||
var valid = this.validator( attachment ),
|
var valid = this.validator( attachment ),
|
||||||
hasAttachment = !! this.getByCid( attachment.cid );
|
hasAttachment = !! this.getByCid( attachment.cid );
|
||||||
|
|
||||||
if ( ! valid && hasAttachment ) {
|
if ( ! valid && hasAttachment )
|
||||||
this.remove( attachment, options );
|
this.remove( attachment, options );
|
||||||
} else if ( valid && ! hasAttachment ) {
|
else if ( valid && ! hasAttachment )
|
||||||
this.add( attachment, options );
|
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;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -769,8 +764,6 @@ window.wp = window.wp || {};
|
||||||
this.evaluate( attachment, { silent: true });
|
this.evaluate( attachment, { silent: true });
|
||||||
}, this );
|
}, this );
|
||||||
|
|
||||||
if ( this.comparator )
|
|
||||||
this.sort( options );
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue