]> cat aescling's git repositories - mastodon.git/blobdiff - app/javascript/mastodon/features/ui/components/embed_modal.js
Add script to make embedded iframes autosize (#4853)
[mastodon.git] / app / javascript / mastodon / features / ui / components / embed_modal.js
index 992aed8a3fa047e6b051f83e09620f12d452f8c8..1afffb51bc92e193b80cdcf5e2889f270197eb6a 100644 (file)
@@ -33,7 +33,8 @@ export default class EmbedModal extends ImmutablePureComponent {
       iframeDocument.close();
 
       iframeDocument.body.style.margin = 0;
-      this.iframe.height = iframeDocument.body.scrollHeight + 'px';
+      this.iframe.width  = iframeDocument.body.scrollWidth;
+      this.iframe.height = iframeDocument.body.scrollHeight;
     });
   }
 
@@ -71,7 +72,6 @@ export default class EmbedModal extends ImmutablePureComponent {
 
           <iframe
             className='embed-modal__iframe'
-            scrolling='no'
             frameBorder='0'
             ref={this.setIframeRef}
             title='preview'
This page took 0.027998 seconds and 3 git commands to generate.