Skip to content

Commit

Permalink
h
Browse files Browse the repository at this point in the history
  • Loading branch information
Ember-ruby committed Jul 1, 2024
1 parent f23cdc1 commit 7f1facb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions app/javascript/flavours/blobfox/components/status.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ class Status extends ImmutablePureComponent {
state = {
isCollapsed: false,
autoCollapsed: false,
tootHeight: 0,
isExpanded: undefined,
showMedia: undefined,
statusId: undefined,
Expand Down Expand Up @@ -289,7 +290,7 @@ class Status extends ImmutablePureComponent {
) {
this.setCollapsed(true);
// Hack to fix timeline jumps on second rendering when auto-collapsing
this.setState({ autoCollapsed: true });
this.setState({ autoCollapsed: true, tootHeight: node.clientHeight});
}

// Hack to fix timeline jumps when a preview card is fetched
Expand Down Expand Up @@ -552,7 +553,7 @@ class Status extends ImmutablePureComponent {
history,
...other
} = this.props;
const { isCollapsed } = this.state;
const { isCollapsed, tootHeight } = this.state;
let background = null;
let attachments = null;

Expand Down Expand Up @@ -864,7 +865,7 @@ class Status extends ImmutablePureComponent {
expanded={isExpanded}
collapsed={isCollapsed}
autoCollapsed={this.state.autoCollapsed}
//tootHeight={node.clientHeight}
tootHeight={tootHeight}
collapseHeight={settings.getIn(['collapsed', 'auto', 'height'])}
onExpandedToggle={this.handleExpandedToggle}
onTranslate={this.handleTranslate}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ class StatusContent extends PureComponent {
const {
status,
collapseHeight,
tootHeight,
muted,
} = this.props;

Expand All @@ -294,7 +295,7 @@ class StatusContent extends PureComponent {
parseInt(collapseHeight)
)
if (tempCollapsedHeight > clientHeight) (
tempCollapsedHeight = clientHeight
tempCollapsedHeight - (clientHeight - tootHeight)
)

tempCollapsedHeight = clientHeight;
Expand Down

0 comments on commit 7f1facb

Please sign in to comment.