Improvements to resizing JS in iframed app container pages

This commit is contained in:
str4d
2012-07-12 13:07:48 +00:00
parent c6d45b22b6
commit 0deaab7c1a
2 changed files with 20 additions and 9 deletions

View File

@ -21,16 +21,20 @@
var failMessage = "<hr><b><%=intl._("Router is down")%><\/b>";
function requestAjax1() { ajax("/xhr1.jsp?requestURI=<%=request.getRequestURI()%>", "xhr", <%=intl.getRefresh()%>000); }
function initAjax() { setTimeout(requestAjax1, <%=intl.getRefresh()%>000); }
function resizeFrame(f) {
var body = f.contentWindow.document.body,
html = f.contentWindow.document.documentElement;
f.style.height = body.scrollHeight + "px";
function injectClass(f) {
f.className += ' iframed';
var doc = 'contentDocument' in f? f.contentDocument : f.contentWindow.document;
doc.body.className += ' iframed';
doc.getElementsByClassName('panel')[0].className += ' iframed';
}
function resizeFrame(f) {
var doc = 'contentDocument' in f? f.contentDocument : f.contentWindow.document;
f.style.height = doc.body.offsetHeight + "px";
}
function injectClass(f) { f.contentWindow.document.body.setAttribute('class', 'iframed'); }
function setupFrame() {
f = document.getElementById("i2ptunnelframe");
resizeFrame(f);
injectClass(f);
resizeFrame(f);
}
</script>
</head><body onload="initAjax()">