Last active
July 28, 2017 09:03
-
-
Save MightyPork/4ddb56de0fefe0ea995daaf7127d329d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: app/javascript/mastodon/components/media_gallery.js | |
IDEA additional info: | |
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | |
<+>UTF-8 | |
=================================================================== | |
--- app/javascript/mastodon/components/media_gallery.js (revision f2233c3e25bd52388798e5d76311896fa8029413) | |
+++ app/javascript/mastodon/components/media_gallery.js (revision ) | |
@@ -173,6 +173,7 @@ | |
onOpenMedia: PropTypes.func.isRequired, | |
intl: PropTypes.object.isRequired, | |
autoPlayGif: PropTypes.bool, | |
+ expanded: PropTypes.bool, | |
}; | |
static defaultProps = { | |
@@ -184,7 +185,7 @@ | |
}; | |
componentWillReceiveProps (nextProps) { | |
- if (nextProps.sensitive !== this.props.sensitive) { | |
+ if (nextProps.sensitive !== this.props.sensitive || nextProps.expanded === false) { | |
this.setState({ visible: !nextProps.sensitive }); | |
} | |
} | |
Index: app/javascript/mastodon/components/status.js | |
IDEA additional info: | |
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | |
<+>UTF-8 | |
=================================================================== | |
--- app/javascript/mastodon/components/status.js (revision f2233c3e25bd52388798e5d76311896fa8029413) | |
+++ app/javascript/mastodon/components/status.js (revision ) | |
@@ -212,13 +212,17 @@ | |
} else if (status.getIn(['media_attachments', 0, 'type']) === 'video') { | |
media = ( | |
<Bundle fetchComponent={VideoPlayer} loading={this.renderLoadingVideoPlayer} > | |
- {Component => <Component media={status.getIn(['media_attachments', 0])} sensitive={status.get('sensitive')} onOpenVideo={this.props.onOpenVideo} />} | |
+ {Component => <Component expanded={isExpanded} media={status.getIn(['media_attachments', 0])} sensitive={status.get('sensitive')} onOpenVideo={this.props.onOpenVideo} />} | |
</Bundle> | |
); | |
} else { | |
media = ( | |
<Bundle fetchComponent={MediaGallery} loading={this.renderLoadingMediaGallery} > | |
- {Component => <Component media={status.get('media_attachments')} sensitive={status.get('sensitive')} height={110} onOpenMedia={this.props.onOpenMedia} autoPlayGif={this.props.autoPlayGif} />} | |
+ {Component => <Component media={status.get('media_attachments')} expanded={isExpanded} sensitive={status.get('sensitive')} height={110} onOpenMedia={this.props.onOpenMedia} autoPlayGif={this.props.autoPlayGif} />} | |
</Bundle> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment