diff --git a/frontend/src/components/dialog/add-reviewer-dialog.js b/frontend/src/components/dialog/add-reviewer-dialog.js
index e2a1359f4d..d61a6fdbad 100644
--- a/frontend/src/components/dialog/add-reviewer-dialog.js
+++ b/frontend/src/components/dialog/add-reviewer-dialog.js
@@ -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 {
{res.data.users[i].name}
;
- 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 {
}
+ {gettext('Close')}
);
diff --git a/frontend/src/components/review-list-view/review-comments.js b/frontend/src/components/review-list-view/review-comments.js
index dab0e537fc..4fa16b4548 100644
--- a/frontend/src/components/review-list-view/review-comments.js
+++ b/frontend/src/components/review-list-view/review-comments.js
@@ -31,12 +31,15 @@ class ReviewComments extends React.Component {
this.accountInfo = {};
}
- listComments = () => {
+ listComments = (scroll) => {
seafileAPI.listReviewComments(reviewID).then((response) => {
response.data.comments.reverse();
this.setState({
commentsList: response.data.comments
});
+ if (scroll) {
+ this.refs.commentsList.scrollTo(0, 10000);
+ }
});
}
@@ -59,7 +62,7 @@ class ReviewComments extends React.Component {
let comment = this.refs.commentTextarea.value;
if (comment.trim().length > 0) {
seafileAPI.addReviewComment(reviewID, comment.trim()).then((res) => {
- this.listComments();
+ this.listComments(true);
this.props.getCommentsNumber();
});
this.refs.commentTextarea.value = '';
@@ -108,6 +111,16 @@ class ReviewComments extends React.Component {
onResizeMouseMove = (event) => {
let rate = 100 - (event.nativeEvent.clientY - 50 ) / this.refs.comment.clientHeight * 100;
if (rate < 20 || rate > 70) {
+ if (rate < 20) {
+ this.setState({
+ commentFooterHeight: 25
+ });
+ }
+ if (rate > 70) {
+ this.setState({
+ commentFooterHeight: 65
+ });
+ }
this.setState({
inResizing: false
});
@@ -150,28 +163,30 @@ class ReviewComments extends React.Component {