TinyMCE, wpView: bail early when the iframe node is not attached to the DOM. We can't load any HTML in it as here is no iframe.contentWindow
in these cases.
See #36434. git-svn-id: https://develop.svn.wordpress.org/trunk@38157 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a08e89ed97
commit
10e93c557b
@ -539,6 +539,14 @@
|
|||||||
dom.add( node, 'span', { 'class': 'wpview-end' } );
|
dom.add( node, 'span', { 'class': 'wpview-end' } );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
// Bail if the iframe node is not attached to the DOM.
|
||||||
|
// Happens when the view is dragged in the editor.
|
||||||
|
// There is a browser restriction when iframes are moved in the DOM. They get emptied.
|
||||||
|
// The iframe will be rerendered after dropping the view node at the new location.
|
||||||
|
if ( ! iframe.contentWindow ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
iframeDoc = iframe.contentWindow.document;
|
iframeDoc = iframe.contentWindow.document;
|
||||||
|
|
||||||
iframeDoc.open();
|
iframeDoc.open();
|
||||||
|
Loading…
Reference in New Issue
Block a user