0
0
Fork 0

Add script to make embedded iframes autosize (#4853)

This commit is contained in:
Eugen Rochko 2017-09-09 16:23:44 +02:00 committed by GitHub
parent bdc8b4fd91
commit 6867681c7c
5 changed files with 76 additions and 10 deletions

View file

@ -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