1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-10 11:21:29 +00:00
This commit is contained in:
MichaelAn
2018-11-12 09:28:02 +08:00
committed by Daniel Pan
parent 0915a44103
commit 66422e3454
5 changed files with 52 additions and 28 deletions

View File

@@ -43,8 +43,6 @@ class AddReviewerDialog extends React.Component {
loadOptions = (value, callback) => {
if (value.trim().length > 0) {
this.Options = [];
let that = this;
seafileAPI.searchUsers(value.trim()).then((res) => {
for (let i = 0 ; i < res.data.users.length; i++) {
let obj = {};
@@ -55,7 +53,8 @@ class AddReviewerDialog extends React.Component {
<img src={res.data.users[i].avatar_url} className="avatar reviewer-select-avatar" alt=""/>
<span className='reviewer-select-name'>{res.data.users[i].name}</span>
</React.Fragment>;
that.Options.push(obj);
this.Options.splice(0, this.Options.length);
this.Options.push(obj);
}
callback(this.Options);
});
@@ -131,7 +130,7 @@ class AddReviewerDialog extends React.Component {
<Button color="primary" onClick={this.addReviewers}>{gettext('Submit')}</Button>
}
<Button color="secondary" onClick={this.props.toggleAddReviewerDialog}>
{gettext('Cancel')}</Button>
{gettext('Close')}</Button>
</ModalFooter>
</Modal>
);