mirror of https://github.com/vector-im/riot-web
improve the fix for https://github.com/vector-im/vector-web/issues/917
parent
9d3b0f6075
commit
0a37f1c478
|
@ -140,34 +140,37 @@ var SearchableEntityList = React.createClass({
|
||||||
}
|
}
|
||||||
|
|
||||||
var list;
|
var list;
|
||||||
if (this.props.truncateAt) { // caller wants list truncated
|
if (this.state.results.length) {
|
||||||
var TruncatedList = sdk.getComponent("elements.TruncatedList");
|
if (this.props.truncateAt) { // caller wants list truncated
|
||||||
list = (
|
var TruncatedList = sdk.getComponent("elements.TruncatedList");
|
||||||
<TruncatedList className="mx_SearchableEntityList_list"
|
list = (
|
||||||
truncateAt={this.state.truncateAt} // use state truncation as it may be expanded
|
<TruncatedList className="mx_SearchableEntityList_list"
|
||||||
createOverflowElement={this._createOverflowEntity}>
|
truncateAt={this.state.truncateAt} // use state truncation as it may be expanded
|
||||||
{this.state.results.map((entity) => {
|
createOverflowElement={this._createOverflowEntity}>
|
||||||
return entity.getJsx();
|
{this.state.results.map((entity) => {
|
||||||
})}
|
return entity.getJsx();
|
||||||
</TruncatedList>
|
})}
|
||||||
);
|
</TruncatedList>
|
||||||
}
|
);
|
||||||
else {
|
}
|
||||||
list = (
|
else {
|
||||||
<div className="mx_SearchableEntityList_list">
|
list = (
|
||||||
{this.state.results.map((entity) => {
|
<div className="mx_SearchableEntityList_list">
|
||||||
return entity.getJsx();
|
{this.state.results.map((entity) => {
|
||||||
})}
|
return entity.getJsx();
|
||||||
</div>
|
})}
|
||||||
);
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
list = <GeminiScrollbar autoshow={true} className="mx_SearchableEntityList_listWrapper">
|
||||||
|
{ list }
|
||||||
|
</GeminiScrollbar>;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={ "mx_SearchableEntityList " + (this.state.query.length ? "mx_SearchableEntityList_expanded" : "") }>
|
<div className={ "mx_SearchableEntityList " + (this.state.query.length ? "mx_SearchableEntityList_expanded" : "") }>
|
||||||
{inputBox}
|
{ inputBox }
|
||||||
<GeminiScrollbar autoshow={true} className="mx_SearchableEntityList_listWrapper">
|
{ list }
|
||||||
{ list }
|
|
||||||
</GeminiScrollbar>
|
|
||||||
{ this.state.query.length ? <div className="mx_SearchableEntityList_hrWrapper"><hr/></div> : '' }
|
{ this.state.query.length ? <div className="mx_SearchableEntityList_hrWrapper"><hr/></div> : '' }
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue