about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/components
diff options
context:
space:
mode:
authorDavid Yip <yipdw@member.fsf.org>2018-04-16 14:41:36 -0500
committerGitHub <noreply@github.com>2018-04-16 14:41:36 -0500
commitf879672554fb328571648a46f4440c9ae9b895c7 (patch)
tree19cb9d2b221e09a34a8a95ebe854d3ef99bf2de2 /app/javascript/flavours/glitch/components
parent1076204eb474d5d085f219aacf38f9889e35e494 (diff)
parent5d96c5ac41f4ae0c43b2cce53cb30b4e76ec5312 (diff)
Merge pull request #424 from ThibG/glitch-soc/features/video-player-improvements
Backport a few MediaGallery/Video changes from upstream (fixes #423)
Diffstat (limited to 'app/javascript/flavours/glitch/components')
-rw-r--r--app/javascript/flavours/glitch/components/media_gallery.js5
-rw-r--r--app/javascript/flavours/glitch/components/status.js1
2 files changed, 4 insertions, 2 deletions
diff --git a/app/javascript/flavours/glitch/components/media_gallery.js b/app/javascript/flavours/glitch/components/media_gallery.js
index 6928af6d6..309308d25 100644
--- a/app/javascript/flavours/glitch/components/media_gallery.js
+++ b/app/javascript/flavours/glitch/components/media_gallery.js
@@ -6,7 +6,7 @@ import IconButton from './icon_button';
 import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
 import { isIOS } from 'flavours/glitch/util/is_mobile';
 import classNames from 'classnames';
-import { autoPlayGif } from 'flavours/glitch/util/initial_state';
+import { autoPlayGif, displaySensitiveMedia } from 'flavours/glitch/util/initial_state';
 
 const messages = defineMessages({
   hidden: {
@@ -208,7 +208,7 @@ export default class MediaGallery extends React.PureComponent {
   };
 
   state = {
-    visible: !this.props.sensitive,
+    visible: !this.props.sensitive || displaySensitiveMedia,
   };
 
   componentWillReceiveProps (nextProps) {
@@ -265,6 +265,7 @@ export default class MediaGallery extends React.PureComponent {
             return (
               <button
                 className='media-spoiler'
+                type='button'
                 onClick={handleOpen}
               >
                 <span className='media-spoiler__warning'>
diff --git a/app/javascript/flavours/glitch/components/status.js b/app/javascript/flavours/glitch/components/status.js
index 2fcc44882..eb621d5d7 100644
--- a/app/javascript/flavours/glitch/components/status.js
+++ b/app/javascript/flavours/glitch/components/status.js
@@ -326,6 +326,7 @@ export default class Status extends ImmutablePureComponent {
             {Component => (<Component
               preview={video.get('preview_url')}
               src={video.get('url')}
+              inline
               sensitive={status.get('sensitive')}
               letterbox={settings.getIn(['media', 'letterbox'])}
               fullwidth={settings.getIn(['media', 'fullwidth'])}