Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Commit

Permalink
fix: small height of block plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
rot1024 committed Mar 4, 2022
1 parent ddb9630 commit 8070a31
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/components/atoms/Plugin/IFrame/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,10 @@ export default function useHook({
horizontalMargin = parseInt(st.getPropertyValue("margin-left"), 10) + parseInt(st.getPropertyValue("margin-right"), 10);
verticalMargin = parseInt(st.getPropertyValue("margin-top"), 10) + parseInt(st.getPropertyValue("margin-bottom"), 10);
const scrollbarW = win.innerWidth - html.offsetWidth;
const scrollbarH = win.innerHeight - html.offsetHeight;
const resize = {
width: html.offsetWidth + horizontalMargin + scrollbarW,
height: html.offsetHeight + verticalMargin + scrollbarH,
};
const width = html.offsetWidth + horizontalMargin + scrollbarW;
const height = html.offsetHeight + verticalMargin;
parent.postMessage({
[${JSON.stringify(autoResizeMessageKey)}]: resize
[${JSON.stringify(autoResizeMessageKey)}]: { width, height }
})
}).observe(document.body.parentElement);
}
Expand Down

0 comments on commit 8070a31

Please sign in to comment.