Add script to make embedded iframes autosize (#4853)
This commit is contained in:
		
					parent
					
						
							
								bdc8b4fd91
							
						
					
				
			
			
				commit
				
					
						6867681c7c
					
				
			
		
					 5 changed files with 76 additions and 10 deletions
				
			
		| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue