mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-01 04:22:15 +08:00
Nextcloud different iframe height approach for #96
This commit is contained in:
parent
921ce9471e
commit
cf8cdc25c3
2 changed files with 20 additions and 18 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
})();
|
||||
});
|
||||
|
|
|
@ -1 +1,3 @@
|
|||
<iframe id="rliframe" style="border: none; width: 100%; height: 100%; position: relative;" tabindex="-1" frameborder="0" src="<?php echo $_['snappymail-iframe-url']; ?>"></iframe><?php OCP\Util::addScript('snappymail', 'resize');
|
||||
<iframe id="rliframe" style="border: none; width: 100%; min-height: 100%; position: relative;" tabindex="-1" frameborder="0" src="<?php echo $_['snappymail-iframe-url']; ?>"></iframe>
|
||||
<?php
|
||||
// OCP\Util::addScript('snappymail', 'resize');
|
||||
|
|
Loading…
Reference in a new issue