summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2015-06-25 11:36:57 -0400
committerCorey Hulen <corey@hulen.com>2015-06-25 11:36:57 -0400
commit0537e87a9087b6d16c5d24e850584b0a0803526d (patch)
tree0198280899bfa17cc750540887e4cf99da34c0a1 /web
parent9a81e76de0861a3e855ca734af90dcace6000734 (diff)
parentc94d6a1c00f42f132736528b036e6c96507a83df (diff)
downloadchat-0537e87a9087b6d16c5d24e850584b0a0803526d.tar.gz
chat-0537e87a9087b6d16c5d24e850584b0a0803526d.tar.bz2
chat-0537e87a9087b6d16c5d24e850584b0a0803526d.zip
Merge pull request #34 from rgarmsen2295/mm-1288
MM-1288
Diffstat (limited to 'web')
-rw-r--r--web/react/components/invite_member_modal.jsx10
1 files changed, 5 insertions, 5 deletions
diff --git a/web/react/components/invite_member_modal.jsx b/web/react/components/invite_member_modal.jsx
index 5980664de..1854107f8 100644
--- a/web/react/components/invite_member_modal.jsx
+++ b/web/react/components/invite_member_modal.jsx
@@ -125,10 +125,12 @@ module.exports = React.createClass({
});
},
removeInviteFields: function(index) {
+ var count = this.state.id_count;
var invite_ids = this.state.invite_ids;
var i = invite_ids.indexOf(index);
- if (index > -1) invite_ids.splice(i, 1);
- this.setState({ invite_ids: invite_ids });
+ if (i > -1) invite_ids.splice(i, 1);
+ if (!invite_ids.length) invite_ids.push(++count);
+ this.setState({ invite_ids: invite_ids, id_count: count });
},
getInitialState: function() {
return {
@@ -154,11 +156,9 @@ module.exports = React.createClass({
invite_sections[index] = (
<div key={"key" + index}>
- { i ?
<div>
- <button type="button" className="btn remove__member" onClick={function(){self.removeInviteFields(index);}}>×</button>
+ <button type="button" className="btn remove__member" onClick={this.removeInviteFields.bind(this, index)}>×</button>
</div>
- : ""}
<div className={ email_error ? "form-group invite has-error" : "form-group invite" }>
<input onKeyUp={this.displayNameKeyUp} type="text" ref={"email"+index} className="form-control" placeholder="email@domain.com" maxLength="64" />
{ email_error }