about summary refs log tree commit diff
path: root/app/serializers/oembed_serializer.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-09-09 16:23:44 +0200
committerGitHub <noreply@github.com>2017-09-09 16:23:44 +0200
commit6867681c7c0b4a5ec48511c013c3f3aa8684bdae (patch)
treeece9c081ceed9ee2b81ac9a6e44a8d72ae361b2d /app/serializers/oembed_serializer.rb
parentbdc8b4fd91aa90c624bca6cd6fe202876b4f654f (diff)
Add script to make embedded iframes autosize (#4853)
Diffstat (limited to 'app/serializers/oembed_serializer.rb')
-rw-r--r--app/serializers/oembed_serializer.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/serializers/oembed_serializer.rb b/app/serializers/oembed_serializer.rb
index bd05da585..af03fd47a 100644
--- a/app/serializers/oembed_serializer.rb
+++ b/app/serializers/oembed_serializer.rb
@@ -40,12 +40,12 @@ class OEmbedSerializer < ActiveModel::Serializer
     attributes = {
       src: embed_short_account_status_url(object.account, object),
       class: 'mastodon-embed',
-      style: 'max-width: 100%; border: none;',
+      style: 'max-width: 100%; border: 0',
       width: width,
       height: height,
     }
 
-    content_tag :iframe, nil, attributes
+    content_tag(:iframe, nil, attributes) + content_tag(:script, nil, src: full_asset_url('embed.js'), async: true)
   end
 
   def width