Media: Fix MEJS error when removing a media player.
This fixes a bug introduced by the upgrade to MediaElement.js, where code calling `wp.media.mixin.removePlayer()` would result in a JS error. Props rafa8626, afercia. Fixes #41787. Built from https://develop.svn.wordpress.org/trunk@41781 git-svn-id: http://core.svn.wordpress.org/trunk@41615 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
0b39f4c99d
commit
53a58e35b7
|
@ -129,18 +129,20 @@ wp.media.mixin = {
|
|||
}
|
||||
|
||||
if ( ! t.isDynamic ) {
|
||||
t.$node.remove();
|
||||
t.node.remove();
|
||||
}
|
||||
|
||||
if ( 'native' !== t.media.pluginType ) {
|
||||
t.$media.remove();
|
||||
if ( 'html5' !== t.media.rendererName ) {
|
||||
t.media.remove();
|
||||
}
|
||||
|
||||
delete window.mejs.players[t.id];
|
||||
|
||||
t.container.remove();
|
||||
t.globalUnbind();
|
||||
delete t.node.player;
|
||||
t.globalUnbind('resize', t.globalResizeCallback);
|
||||
t.globalUnbind('keydown', t.globalKeydownCallback);
|
||||
t.globalUnbind('click', t.globalClickCallback);
|
||||
delete t.media.player;
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.9-beta1-41780';
|
||||
$wp_version = '4.9-beta1-41781';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue