MELS: either expanded or summary, not both

Fixes vector-im/riot-web#3097
This commit is contained in:
Luke Barnard 2017-02-09 15:14:16 +00:00
parent 7ba9e27893
commit 8d3876c7d0

View file

@ -108,7 +108,7 @@ module.exports = React.createClass({
} }
return ( return (
<span> <span className="mx_TextualEvent mx_MemberEventListSummary_summary">
{summaries.join(", ")} {summaries.join(", ")}
</span> </span>
); );
@ -264,7 +264,7 @@ module.exports = React.createClass({
); );
}); });
return ( return (
<span> <span className="mx_MemberEventListSummary_avatars">
{avatars} {avatars}
</span> </span>
); );
@ -397,31 +397,28 @@ module.exports = React.createClass({
(seq1, seq2) => aggregate.indices[seq1] > aggregate.indices[seq2] (seq1, seq2) => aggregate.indices[seq1] > aggregate.indices[seq2]
); );
const avatars = this._renderAvatars(avatarMembers); let summaryContainer = null;
const summary = this._renderSummary(aggregate.names, orderedTransitionSequences); if (!expanded) {
const toggleButton = ( summaryContainer = (
<a className="mx_MemberEventListSummary_toggle" onClick={this._toggleSummary}>
{expanded ? 'collapse' : 'expand'}
</a>
);
const summaryContainer = (
<div className="mx_EventTile_line"> <div className="mx_EventTile_line">
<div className="mx_EventTile_info"> <div className="mx_EventTile_info">
<span className="mx_MemberEventListSummary_avatars"> {this._renderAvatars(avatarMembers)}
{avatars} {this._renderSummary(aggregate.names, orderedTransitionSequences)}
</span>
<span className="mx_TextualEvent mx_MemberEventListSummary_summary">
{summary}
</span>&nbsp;
{toggleButton}
</div> </div>
</div> </div>
); );
}
const toggleButton = (
<div className={"mx_MemberEventListSummary_toggle"} onClick={this._toggleSummary}>
{expanded ? 'collapse' : 'expand'}
</div>
);
return ( return (
<div className="mx_MemberEventListSummary"> <div className="mx_MemberEventListSummary">
{toggleButton}
{summaryContainer} {summaryContainer}
{expanded ? <div className="mx_MemberEventListSummary_line">&nbsp;</div> : null}
{expandedEvents} {expandedEvents}
</div> </div>
); );