Preserve layout for large isolated objects

This commit is contained in:
Pablo de Oliveira 2013-10-29 23:55:39 +01:00
parent b1eba452c9
commit fcbd398ad2

View File

@ -334,8 +334,9 @@ var IPython = (function (IPython) {
if (md['isolated']) {
// Create an iframe to isolate the subarea from the rest of the
// document
var iframe = $('<iframe/>');
var iframe = $('<iframe/>').addClass('box-flex1');
iframe.attr('height', 1);
iframe.css({'width':'100%', 'display':'block'});
iframe.attr('frameborder', 0);
iframe.attr('scrolling', 'auto');
@ -355,8 +356,7 @@ var IPython = (function (IPython) {
this.contentDocument.close();
var body = this.contentDocument.body;
// Adjust the iframe width and height
iframe.width(body.scrollWidth + 'px');
// Adjust the iframe height automatically
iframe.height(body.scrollHeight + 'px');
});