iframe resizer use internal body
[kengrimes.com/theme.git] / static / js / main.js
index a699357..b0ada37 100644 (file)
@@ -22,5 +22,5 @@ window.onload = () => {
 }
 const resizeIFrame = (iframe) => {
   iframe.style.height = 0
-  iframe.style.height = document.body.scrollHeight + 'px';
+  iframe.style.height = iframe.contentWindow.document.body.scrollHeight + 'px';
 }