From: Michael M Slusarz Date: Fri, 9 Oct 2009 22:34:06 +0000 (-0600) Subject: yet more IFRAME HTML tweaking X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=4418edc8e399ed4cc7d5c1f9a73128577816d3a6;p=horde.git yet more IFRAME HTML tweaking --- 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' }); } };