about summary refs log tree commit diff
path: root/app/javascript/themes/glitch/components
diff options
context:
space:
mode:
authorkibigo! <marrus-sh@users.noreply.github.com>2017-11-18 11:05:23 -0800
committerkibigo! <marrus-sh@users.noreply.github.com>2017-11-18 11:05:23 -0800
commit672ace5a202caf483c558a06b7e694ece12bb91b (patch)
treec05397a3f0514315b17f3e3427e02beb8194465f /app/javascript/themes/glitch/components
parentf51f7b0e0617301b95df507dd4a11a6d03006049 (diff)
Media styling
Diffstat (limited to 'app/javascript/themes/glitch/components')
-rw-r--r--app/javascript/themes/glitch/components/media_gallery.js5
-rw-r--r--app/javascript/themes/glitch/components/status.js6
2 files changed, 8 insertions, 3 deletions
diff --git a/app/javascript/themes/glitch/components/media_gallery.js b/app/javascript/themes/glitch/components/media_gallery.js
index 05390c82f..b6b40c585 100644
--- a/app/javascript/themes/glitch/components/media_gallery.js
+++ b/app/javascript/themes/glitch/components/media_gallery.js
@@ -214,6 +214,7 @@ export default class MediaGallery extends React.PureComponent {
   render () {
     const { media, intl, sensitive, letterbox, fullwidth } = this.props;
     const { visible } = this.state;
+    const size = media.take(4).size;
 
     let children;
 
@@ -233,8 +234,6 @@ export default class MediaGallery extends React.PureComponent {
         </button>
       );
     } else {
-      const size = media.take(4).size;
-
       if (this.isStandaloneEligible()) {
         children = <Item standalone onClick={this.handleClick} attachment={media.get(0)} />;
       } else {
@@ -243,7 +242,7 @@ export default class MediaGallery extends React.PureComponent {
     }
 
     return (
-      <div className={`media-gallery ${fullwidth ? 'full-width' : ''}`}>
+      <div className={`media-gallery size-${size} ${fullwidth ? 'full-width' : ''}`}>
         <div className={classNames('spoiler-button', { 'spoiler-button--visible': visible })}>
           <IconButton title={intl.formatMessage(messages.toggle_visible)} icon={visible ? 'eye' : 'eye-slash'} overlay onClick={this.handleOpen} />
         </div>
diff --git a/app/javascript/themes/glitch/components/status.js b/app/javascript/themes/glitch/components/status.js
index cf2fbe21e..e2ef47f5f 100644
--- a/app/javascript/themes/glitch/components/status.js
+++ b/app/javascript/themes/glitch/components/status.js
@@ -228,6 +228,10 @@ export default class Status extends ImmutablePureComponent {
     this.props.onMoveDown(this.props.status.get('id'));
   }
 
+  handleRef = c => {
+    this.node = c;
+  }
+
   renderLoadingMediaGallery () {
     return <div className='media_gallery' style={{ height: '110px' }} />;
   }
@@ -238,6 +242,7 @@ export default class Status extends ImmutablePureComponent {
 
   render () {
     const {
+      handleRef,
       parseClick,
       setExpansion,
     } = this;
@@ -389,6 +394,7 @@ export default class Status extends ImmutablePureComponent {
             ),
           }}
           {...selectorAttribs}
+          ref={handleRef}
         >
           {prepend && account ? (
             <StatusPrepend