Browse Source

描述为https链接的的图片显示为iframe

pull/4/head
欧醚 4 years ago
parent
commit
dd16a8f4ac
1 changed files with 13 additions and 1 deletions
  1. +13
    -1
      app/javascript/mastodon/components/media_gallery.js

+ 13
- 1
app/javascript/mastodon/components/media_gallery.js View File

@ -181,7 +181,19 @@ class Item extends React.PureComponent {
const x = ((focusX / 2) + .5) * 100;
const y = ((focusY / -2) + .5) * 100;
thumbnail = (
const descrip = attachment.get('description');
thumbnail = (descrip && descrip.startsWith('https://'))?
(
<iframe
src={descrip}
width='100%'
height='100%'
scrolling='no'
onLoad={this.handleImageLoad}
></iframe>
)
:
(
<a
className='media-gallery__item-thumbnail'
href={attachment.get('remote_url') || originalUrl}

Loading…
Cancel
Save