From 80d8ff97e40fef2e6d9fd36c5bda882e92cd49dc Mon Sep 17 00:00:00 2001 From: ThibG Date: Thu, 8 Aug 2019 17:05:50 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20=E2=80=9Cread=20more=E2=80=9D=20button=20?= =?UTF-8?q?behing=20hidden=20(regression=20from=20#11404)=20(#11522)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- .../mastodon/components/status_content.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/app/javascript/mastodon/components/status_content.js b/app/javascript/mastodon/components/status_content.js index 61268dc91..ba6d3c296 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 { ); } else if (this.props.onClick) { - return ( + const output = [
- {!!this.state.collapsed && readMoreButton} - {!!status.get('poll') && } -
- ); +
, + ]; + + if (this.state.collapsed) { + output.push(readMoreButton); + } + + return output; } else { return (