diff --git a/integrations/nextcloud/snappymail/js/resize.js b/integrations/nextcloud/snappymail/js/resize.js index bacff7aa0..93a2d2741 100644 --- a/integrations/nextcloud/snappymail/js/resize.js +++ b/integrations/nextcloud/snappymail/js/resize.js @@ -1,18 +1,18 @@ -(()=>{ - - const - buffer = 0, //was 5 but this was creating a white space of 5px at the bottom of the page - ifr = document.getElementById('rliframe'), - pageY = elem => elem.offsetParent ? (elem.offsetTop + pageY(elem.offsetParent)) : elem.offsetTop, - resizeIframe = () => { - var height = document.documentElement.clientHeight; - height -= pageY(ifr) + buffer; - height = (height < 0) ? 0 : height; - ifr.style.height = height + 'px'; - }; - if (ifr) { - ifr.onload = resizeIframe; - window.onresize = resizeIframe; +document.addEventListener('readystatechange', () => { + if (document.readyState === 'complete') { + const + buffer = 0, //was 5 but this was creating a white space of 5px at the bottom of the page + ifr = document.getElementById('rliframe'), + pageY = elem => elem.offsetParent ? (elem.offsetTop + pageY(elem.offsetParent)) : elem.offsetTop, + resizeIframe = () => { + var height = document.documentElement.clientHeight; + height -= pageY(ifr) + buffer; + height = (height < 0) ? 0 : height; + ifr.style.height = height + 'px'; + }; + if (ifr) { + ifr.onload = resizeIframe; + window.onresize = resizeIframe; + } } - -})(); +}); diff --git a/integrations/nextcloud/snappymail/templates/index.php b/integrations/nextcloud/snappymail/templates/index.php index fcdd98db2..f304654fb 100755 --- a/integrations/nextcloud/snappymail/templates/index.php +++ b/integrations/nextcloud/snappymail/templates/index.php @@ -1 +1,3 @@ -"> +