TinyMCE wpView sandbox iframes:

- Make them transparent.
- Don't load tons of unrelated styles that can break them. This could result in minimal styling mismatch to the front-end, but keeps the views working well and looking good.
Props avryl, fixes #29048.
Built from https://develop.svn.wordpress.org/trunk@29543


git-svn-id: http://core.svn.wordpress.org/trunk@29319 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz
2014-08-19 21:53:15 +00:00
parent cee3560f49
commit afdb25bd56
3 changed files with 15 additions and 14 deletions

View File

@@ -156,8 +156,18 @@ window.wp = window.wp || {};
'<html>' +
'<head>' +
'<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />' +
'<style>' +
'html, body#wpview-iframe-sandbox {' +
'background: transparent;' +
'padding: 0;' +
'margin: 0;' +
'}' +
'body#wpview-iframe-sandbox {' +
'padding: 1px 0;' +
'}' +
'</style>' +
'</head>' +
'<body data-context="iframe-sandbox" style="padding: 0; margin: 0;" class="' + editor.getBody().className + '">' +
'<body id="wpview-iframe-sandbox">' +
html +
'</body>' +
'</html>'
@@ -166,7 +176,7 @@ window.wp = window.wp || {};
resize = function() {
// Make sure the iframe still exists.
iframe.contentWindow && $( iframe ).height( $( iframeDoc.body ).height() );
iframe.contentWindow && $( iframe ).height( $( iframeDoc.body ).outerHeight() );
};
if ( MutationObserver ) {