mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-10-31 09:33:33 +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 @@
|
|||
(()=>{
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
})();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue