Allow collapsing ReplyThread from MessageContextMenu
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
8b1e411d6b
commit
a90bd6cd4f
2 changed files with 20 additions and 6 deletions
|
@ -52,6 +52,8 @@ export default class ReplyThread extends React.Component {
|
|||
};
|
||||
|
||||
this.onQuoteClick = this.onQuoteClick.bind(this);
|
||||
this.canCollapse = this.canCollapse.bind(this);
|
||||
this.collapse = this.collapse.bind(this);
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
|
@ -64,6 +66,14 @@ export default class ReplyThread extends React.Component {
|
|||
this.unmounted = true;
|
||||
}
|
||||
|
||||
canCollapse() {
|
||||
return this.state.events.length > 1;
|
||||
}
|
||||
|
||||
collapse() {
|
||||
this.initialize();
|
||||
}
|
||||
|
||||
async initialize() {
|
||||
const {parentEv} = this.props;
|
||||
const inReplyTo = ReplyThread.getInReplyTo(parentEv);
|
||||
|
@ -227,11 +237,11 @@ export default class ReplyThread extends React.Component {
|
|||
};
|
||||
}
|
||||
|
||||
static getQuote(parentEv, onWidgetLoad) {
|
||||
static getThread(parentEv, onWidgetLoad, ref) {
|
||||
if (!SettingsStore.isFeatureEnabled("feature_rich_quoting") || !ReplyThread.getInReplyTo(parentEv)) {
|
||||
return <div />;
|
||||
}
|
||||
return <ReplyThread parentEv={parentEv} onWidgetLoad={onWidgetLoad} />;
|
||||
return <ReplyThread parentEv={parentEv} onWidgetLoad={onWidgetLoad} ref={ref} />;
|
||||
}
|
||||
|
||||
render() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue