summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorReed Garmsen <rgarmsen2295@gmail.com>2015-06-17 18:37:28 -0700
committerReed Garmsen <rgarmsen2295@gmail.com>2015-06-17 18:37:28 -0700
commit66425c97e49615111448aa24e31225dfa3b51cda (patch)
tree4774a65e5e5abbed599aa3291020a699090067b9 /web
parent5b546450a0d85a9f05507fdfe1265e2f13422a23 (diff)
downloadchat-66425c97e49615111448aa24e31225dfa3b51cda.tar.gz
chat-66425c97e49615111448aa24e31225dfa3b51cda.tar.bz2
chat-66425c97e49615111448aa24e31225dfa3b51cda.zip
Added ability to remove the first entry of a Invite New Members list (or clear it if there's only one entry
Diffstat (limited to 'web')
-rw-r--r--web/react/components/invite_member_modal.jsx8
1 files changed, 5 insertions, 3 deletions
diff --git a/web/react/components/invite_member_modal.jsx b/web/react/components/invite_member_modal.jsx
index 1d2bbed84..a1b8da6e4 100644
--- a/web/react/components/invite_member_modal.jsx
+++ b/web/react/components/invite_member_modal.jsx
@@ -90,10 +90,12 @@ module.exports = React.createClass({
this.setState({ invite_ids: invite_ids, id_count: count });
},
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 {
@@ -119,7 +121,7 @@ module.exports = React.createClass({
invite_sections[index] = (
<div key={"key" + index}>
- { i ?
+ { true ?
<div>
<button type="button" className="btn remove__member" onClick={function(){self.removeInviteFields(index);}}>×</button>
</div>