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}> <div className="mx_EventTile_line">
{expanded ? 'collapse' : 'expand'} <div className="mx_EventTile_info">
</a> {this._renderAvatars(avatarMembers)}
); {this._renderSummary(aggregate.names, orderedTransitionSequences)}
</div>
const summaryContainer = (
<div className="mx_EventTile_line">
<div className="mx_EventTile_info">
<span className="mx_MemberEventListSummary_avatars">
{avatars}
</span>
<span className="mx_TextualEvent mx_MemberEventListSummary_summary">
{summary}
</span>&nbsp;
{toggleButton}
</div> </div>
);
}
const toggleButton = (
<div className={"mx_MemberEventListSummary_toggle"} onClick={this._toggleSummary}>
{expanded ? 'collapse' : 'expand'}
</div> </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>
); );