diff options
author | ThibG <thib@sitedethib.com> | 2019-08-08 17:05:50 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2019-08-10 00:18:22 +0200 |
commit | 80d8ff97e40fef2e6d9fd36c5bda882e92cd49dc (patch) | |
tree | 5599a96434c8d53662b0e7b89b57753db010721b | |
parent | d5963d9401b183336ab0247f5e2ffddc210d95d7 (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 61268dc9156..ba6d3c29626 100644 --- a/app/javascript/mastodon/components/status_content.js +++ b/app/javascript/mastodon/components/status_content.js @@ -165,11 +165,6 @@ export default class StatusContent extends React.PureComponent { } } - handleCollapsedClick = (e) => { - e.preventDefault(); - this.setState({ collapsed: !this.state.collapsed }); - } - setRef = (c) => { this.node = c; } @@ -233,15 +228,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}> |