In `wp.media.model.PostAudio` and `wp.media.model.PostVideo`, use Underscore's `unset` method when clearing out properties when the attachment changes.

See #27016.



git-svn-id: https://develop.svn.wordpress.org/trunk@27477 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2014-03-09 01:05:48 +00:00
parent 67512aa18a
commit 8064f5dbc4
1 changed files with 4 additions and 4 deletions

View File

@ -472,11 +472,11 @@ window.wp = window.wp || {};
if ( _.contains( wp.media.view.settings.embedExts, this.extension ) ) { if ( _.contains( wp.media.view.settings.embedExts, this.extension ) ) {
this.set( this.extension, attachment.get( 'url' ) ); this.set( this.extension, attachment.get( 'url' ) );
} else { } else {
this.set( this.extension, '' ); this.unset( this.extension );
} }
_.each( _.without( wp.media.view.settings.embedExts, this.extension ), function (ext) { _.each( _.without( wp.media.view.settings.embedExts, this.extension ), function (ext) {
self.set( ext, '' ); self.unset( ext );
} ); } );
} }
}); });
@ -501,11 +501,11 @@ window.wp = window.wp || {};
if ( _.contains( wp.media.view.settings.embedExts, this.extension ) ) { if ( _.contains( wp.media.view.settings.embedExts, this.extension ) ) {
this.set( this.extension, attachment.get( 'url' ) ); this.set( this.extension, attachment.get( 'url' ) );
} else { } else {
this.set( this.extension, '' ); this.unset( this.extension );
} }
_.each( _.without( wp.media.view.settings.embedExts, this.extension ), function (ext) { _.each( _.without( wp.media.view.settings.embedExts, this.extension ), function (ext) {
self.set( ext, '' ); self.unset( ext );
} ); } );
} }
}); });