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

Props koopersmith
fixes #22718


git-svn-id: http://core.svn.wordpress.org/trunk@23045 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Ryan Boren 2012-12-04 22:19:08 +00:00
parent 0bd02ac6bb
commit edf9769d26
1 changed files with 7 additions and 1 deletions

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 );
}