Added ability to remove the first entry of a Invite New Members list (or clear it if there's only one entry
Этот коммит содержится в:
@@ -90,10 +90,12 @@ module.exports = React.createClass({
|
|||||||
this.setState({ invite_ids: invite_ids, id_count: count });
|
this.setState({ invite_ids: invite_ids, id_count: count });
|
||||||
},
|
},
|
||||||
removeInviteFields: function(index) {
|
removeInviteFields: function(index) {
|
||||||
|
var count = this.state.id_count;
|
||||||
var invite_ids = this.state.invite_ids;
|
var invite_ids = this.state.invite_ids;
|
||||||
var i = invite_ids.indexOf(index);
|
var i = invite_ids.indexOf(index);
|
||||||
if (index > -1) invite_ids.splice(i, 1);
|
if (i > -1) invite_ids.splice(i, 1);
|
||||||
this.setState({ invite_ids: invite_ids });
|
if (!invite_ids.length) invite_ids.push(++count);
|
||||||
|
this.setState({ invite_ids: invite_ids, id_count: count });
|
||||||
},
|
},
|
||||||
getInitialState: function() {
|
getInitialState: function() {
|
||||||
return {
|
return {
|
||||||
@@ -119,7 +121,7 @@ module.exports = React.createClass({
|
|||||||
|
|
||||||
invite_sections[index] = (
|
invite_sections[index] = (
|
||||||
<div key={"key" + index}>
|
<div key={"key" + index}>
|
||||||
{ i ?
|
{ true ?
|
||||||
<div>
|
<div>
|
||||||
<button type="button" className="btn remove__member" onClick={function(){self.removeInviteFields(index);}}>×</button>
|
<button type="button" className="btn remove__member" onClick={function(){self.removeInviteFields(index);}}>×</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user