mirror of
https://github.com/acid-info/lsd.git
synced 2025-01-12 18:14:25 +00:00
17 lines
474 B
HTML
17 lines
474 B
HTML
<script>
|
|
// This script is used to send the height of the storybook iframe to the parent window.
|
|
window.addEventListener('message', function (event) {
|
|
if (event.data && event.data.type === 'requestHeight') {
|
|
const height =
|
|
document.documentElement.scrollHeight || document.body.scrollHeight
|
|
event.source.postMessage(
|
|
{
|
|
type: 'iframeHeightResponse',
|
|
height: height,
|
|
},
|
|
'*',
|
|
)
|
|
}
|
|
})
|
|
</script>
|