diff options
author | ThibG <thib@sitedethib.com> | 2019-08-08 17:05:50 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2019-08-08 17:05:50 +0200 |
commit | fd0104369102cbc89e5fb42e41e36d4b233d4603 (patch) | |
tree | 7d19b04234fa57004db90989cd8cd74f504b9cbb | |
parent | e823b492147a7d7fca7a5a91dacc201fa2064e2c (diff) |
Fix “read more” button behing hidden (regression from #11404) (#11522)
* Fix “read more” button behing hidden (regression from #11404) This has the side-effect of putting the “Read more” button below possibly trunctated polls instead of putting the poll below the “Read more” * Remove dead code
-rw-r--r-- | app/javascript/mastodon/components/status_content.js | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/app/javascript/mastodon/components/status_content.js b/app/javascript/mastodon/components/status_content.js index 76117f1d9..6aa0bfcc2 100644 --- a/app/javascript/mastodon/components/status_content.js +++ b/app/javascript/mastodon/components/status_content.js @@ -166,11 +166,6 @@ export default class StatusContent extends React.PureComponent { } } - handleCollapsedClick = (e) => { - e.preventDefault(); - this.setState({ collapsed: !this.state.collapsed }); - } - setRef = (c) => { this.node = c; } @@ -234,15 +229,19 @@ export default class StatusContent extends React.PureComponent { </div> ); } else if (this.props.onClick) { - return ( + const output = [ <div className={classNames} ref={this.setRef} tabIndex='0' style={directionStyle} onMouseDown={this.handleMouseDown} onMouseUp={this.handleMouseUp}> <div className='status__content__text status__content__text--visible' style={directionStyle} dangerouslySetInnerHTML={content} lang={status.get('language')} /> - {!!this.state.collapsed && readMoreButton} - {!!status.get('poll') && <PollContainer pollId={status.get('poll')} />} - </div> - ); + </div>, + ]; + + if (this.state.collapsed) { + output.push(readMoreButton); + } + + return output; } else { return ( <div className={classNames} ref={this.setRef} tabIndex='0' style={directionStyle}> |