Used JS changes to fix iframed i2ptunnel scrollbar issue in CSS

Also added comments to the JS to point out that the issue is that
offsetHeight doesn't include the very top or bottom margins.
This commit is contained in:
str4d
2012-07-12 13:34:19 +00:00
parent 0deaab7c1a
commit 46ca3ab51d
4 changed files with 16 additions and 0 deletions

View File

@@ -28,6 +28,10 @@
doc.getElementsByClassName('panel')[0].className += ' iframed';
}
function resizeFrame(f) {
// offsetHeight returns the height of the visible area for an object, in pixels.
// The value contains the height with the padding, scrollBar, and the border,
// but does not include the margin. Therefore, any content within the iframe
// should have no margins at the very top or very bottom to avoid a scrollbar.
var doc = 'contentDocument' in f? f.contentDocument : f.contentWindow.document;
f.style.height = doc.body.offsetHeight + "px";
}

View File

@@ -27,6 +27,10 @@
doc.body.className += ' iframed';
}
function resizeFrame(f) {
// offsetHeight returns the height of the visible area for an object, in pixels.
// The value contains the height with the padding, scrollBar, and the border,
// but does not include the margin. Therefore, any content within the iframe
// should have no margins at the very top or very bottom to avoid a scrollbar.
var doc = 'contentDocument' in f? f.contentDocument : f.contentWindow.document;
f.style.height = doc.body.offsetHeight + "px";
}

View File

@@ -1321,3 +1321,7 @@ div.applabel {
}
/* end home page */
iframe.iframed {
margin: 15px 0 0;
}

View File

@@ -225,6 +225,10 @@ hr {
margin: 16px auto -8px auto !important;
}
.iframed .panel.iframed {
margin: 0 auto -8px auto !important;
}
.panel td:first-child {
font-weight: bold;
}