mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-05 23:47:03 +03: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 @@
|
||||||
(()=>{
|
document.addEventListener('readystatechange', () => {
|
||||||
|
if (document.readyState === 'complete') {
|
||||||
const
|
const
|
||||||
buffer = 0, //was 5 but this was creating a white space of 5px at the bottom of the page
|
buffer = 0, //was 5 but this was creating a white space of 5px at the bottom of the page
|
||||||
ifr = document.getElementById('rliframe'),
|
ifr = document.getElementById('rliframe'),
|
||||||
pageY = elem => elem.offsetParent ? (elem.offsetTop + pageY(elem.offsetParent)) : elem.offsetTop,
|
pageY = elem => elem.offsetParent ? (elem.offsetTop + pageY(elem.offsetParent)) : elem.offsetTop,
|
||||||
resizeIframe = () => {
|
resizeIframe = () => {
|
||||||
var height = document.documentElement.clientHeight;
|
var height = document.documentElement.clientHeight;
|
||||||
height -= pageY(ifr) + buffer;
|
height -= pageY(ifr) + buffer;
|
||||||
height = (height < 0) ? 0 : height;
|
height = (height < 0) ? 0 : height;
|
||||||
ifr.style.height = height + 'px';
|
ifr.style.height = height + 'px';
|
||||||
};
|
};
|
||||||
if (ifr) {
|
if (ifr) {
|
||||||
ifr.onload = resizeIframe;
|
ifr.onload = resizeIframe;
|
||||||
window.onresize = 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…
Add table
Add a link
Reference in a new issue