From 4418edc8e399ed4cc7d5c1f9a73128577816d3a6 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Fri, 9 Oct 2009 16:34:06 -0600 Subject: [PATCH] yet more IFRAME HTML tweaking --- imp/js/imp.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/imp/js/imp.js b/imp/js/imp.js index 1f0cc27f6..c0fa9351a 100644 --- a/imp/js/imp.js +++ b/imp/js/imp.js @@ -99,10 +99,12 @@ document.observe('dom:loaded', function() { IMP.iframeResize = function(id, defer) { id = $(id); - if (!defer && Prototype.Browser.IE) { + id.setStyle({ height: Math.max(id.contentWindow.document.body.scrollHeight, id.contentWindow.document.lastChild.scrollHeight) + 'px' }); + if (!defer) { + // For whatever reason, browsers will report different heights + // after the initial height setting. Deferring a second height + // setting seems to work most of the time to fix this. this.iframeResize.bind(this, id, true).defer(); - } else { - id.setStyle({ height: Math.max(id.contentWindow.document.body.offsetHeight, id.contentWindow.document.lastChild.offsetHeight) + 'px' }); } }; -- 2.11.0