First pass at adding multiple addresses, can only add from AddressSelector at the moment
parent
5acdb8233b
commit
4836025a1d
|
@ -236,28 +236,29 @@ module.exports = React.createClass({
|
||||||
var AddressSelector = sdk.getComponent("elements.AddressSelector");
|
var AddressSelector = sdk.getComponent("elements.AddressSelector");
|
||||||
this.scrollElement = null;
|
this.scrollElement = null;
|
||||||
|
|
||||||
var query;
|
var query = [];
|
||||||
|
// create the invite list
|
||||||
if (this.state.inviteList.length > 0) {
|
if (this.state.inviteList.length > 0) {
|
||||||
var AddressTile = sdk.getComponent("elements.AddressTile");
|
var AddressTile = sdk.getComponent("elements.AddressTile");
|
||||||
query = [];
|
|
||||||
for (let i = 0; i < this.state.inviteList.length; i++) {
|
for (let i = 0; i < this.state.inviteList.length; i++) {
|
||||||
query.push(
|
query.push(
|
||||||
<AddressTile key={i} user={this.state.inviteList[0]} canDismiss={true} onDismissed={ this.onDismissed(i) } />
|
<AddressTile key={i} user={this.state.inviteList[i]} canDismiss={true} onDismissed={ this.onDismissed(i) } />
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
query = (
|
|
||||||
<textarea rows="1"
|
|
||||||
id="textinput"
|
|
||||||
ref="textinput"
|
|
||||||
className="mx_ChatInviteDialog_input"
|
|
||||||
onChange={this.onQueryChanged}
|
|
||||||
placeholder={this.props.placeholder}
|
|
||||||
defaultValue={this.props.value}
|
|
||||||
autoFocus={this.props.focus}>
|
|
||||||
</textarea>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
// Add the query at the end
|
||||||
|
query.push(
|
||||||
|
<textarea key={this.state.inviteList.length}
|
||||||
|
rows="1"
|
||||||
|
id="textinput"
|
||||||
|
ref="textinput"
|
||||||
|
className="mx_ChatInviteDialog_input"
|
||||||
|
onChange={this.onQueryChanged}
|
||||||
|
placeholder={this.props.placeholder}
|
||||||
|
defaultValue={this.props.value}
|
||||||
|
autoFocus={this.props.focus}>
|
||||||
|
</textarea>
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mx_ChatInviteDialog" onKeyDown={this.onKeyDown}>
|
<div className="mx_ChatInviteDialog" onKeyDown={this.onKeyDown}>
|
||||||
|
|
|
@ -99,8 +99,11 @@ module.exports = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
selectAddress: function(index) {
|
selectAddress: function(index) {
|
||||||
this.props.onSelected(index);
|
// Only try to select an address if one exists
|
||||||
this.setState({ hover: false });
|
if (this.props.addressList.length !== 0) {
|
||||||
|
this.props.onSelected(index);
|
||||||
|
this.setState({ hover: false });
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
createAddressListTiles: function() {
|
createAddressListTiles: function() {
|
||||||
|
|
Loading…
Reference in New Issue