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. Built from https://develop.svn.wordpress.org/trunk@27477 git-svn-id: http://core.svn.wordpress.org/trunk@27321 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
dc00fc7e7f
commit
f0863476f5
|
@ -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 );
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue