Add keyboard shortcut to collapse/uncollapse toots

This commit is contained in:
Thibaut Girka
2019-04-27 19:17:42 +02:00
committed by ThibG
parent f3acf8f414
commit 67fb9a8679
3 changed files with 24 additions and 1 deletions

View File

@ -367,6 +367,14 @@ export default class Status extends ImmutablePureComponent {
this.props.onMoveDown(this.props.containerId || this.props.id, e.target.getAttribute('data-featured'));
}
handleHotkeyCollapse = e => {
if (!this.props.settings.getIn(['collapsed', 'enabled']))
return;
this.setCollapsed(!this.state.isCollapsed);
}
handleRef = c => {
this.node = c;
}
@ -556,6 +564,7 @@ export default class Status extends ImmutablePureComponent {
moveDown: this.handleHotkeyMoveDown,
toggleSpoiler: this.handleExpandedToggle,
bookmark: this.handleHotkeyBookmark,
toggleCollapse: this.handleHotkeyCollapse,
};
const computedClass = classNames('status', `status-${status.get('visibility')}`, {