In the media modal, clear attachment details when clearing the selection.

Props koopersmith
fixes #22718


git-svn-id: https://develop.svn.wordpress.org/trunk@23045 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2012-12-04 22:19:08 +00:00
parent 71e16147bb
commit b5fdf3753f

View File

@ -858,8 +858,14 @@ window.wp = window.wp || {};
// If single has changed, fire an event.
if ( this._single !== previous ) {
if ( previous )
if ( previous ) {
previous.trigger( 'selection:unsingle', previous, this );
// If the model was already removed, trigger the collection
// event manually.
if ( ! this.getByCid( previous.cid ) )
this.trigger( 'selection:unsingle', previous, this );
}
if ( this._single )
this._single.trigger( 'selection:single', this._single, this );
}