Browse Source

Update resizing logic, listen to <main> tag changes and not <body>.

pull/1/head
Roman Axelrod 3 years ago
parent
commit
12ef5e0570
  1. 6
      layouts/scripts/frame-index.js

6
layouts/scripts/frame-index.js

@ -8,10 +8,8 @@ function setupResizeListener() {
const RESIZE_CODE = 'resize:';
const resizeObserver = new ResizeObserver(entries => {
setTimeout(() => {
const height = document.body.scrollHeight;
window.parent.postMessage(RESIZE_CODE + JSON.stringify({height}), '*');
}, 200);
const height = document.querySelector('body > main').scrollHeight;
window.parent.postMessage(RESIZE_CODE + JSON.stringify({height}), '*');
})
resizeObserver.observe(document.body);

Loading…
Cancel
Save