1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 15:09:14 +00:00
This commit is contained in:
Michael18811380328
2018-12-06 17:56:31 +08:00
parent 1891c4e198
commit 81f33b6ca4
4 changed files with 22 additions and 29 deletions

View File

@@ -22,7 +22,6 @@ import { findRange } from '@seafile/slate-react';
import { Nav, NavItem, NavLink, TabContent, TabPane } from 'reactstrap';
import classnames from 'classnames';
import HistoryList from './pages/review/history-list';
import Plain from 'slate-plain-serializer';
import { Document, Block, Value } from 'slate';
import './assets/css/fa-solid.css';
@@ -55,7 +54,6 @@ class DraftReview extends React.Component {
totalReversionCount: 0,
changedNodes: [],
isShowCommentDialog: false,
commentBtnTop: '-1000px',
};
this.selectedText = '';
this.newIndex = null;
@@ -239,11 +237,7 @@ class DraftReview extends React.Component {
}
}
let style = this.refs.commentbtn.style;
let commentBtnTop = `${rect.top - 100 + this.refs.viewContent.scrollTop}px`;
style.top = commentBtnTop;
this.setState({
commentBtnTop: commentBtnTop
});
style.top = `${rect.top - 100 + this.refs.viewContent.scrollTop}px`;
return range;
}
else {
@@ -557,16 +551,6 @@ class DraftReview extends React.Component {
/>
}
<i className="fa fa-plus-square review-comment-btn" ref="commentbtn" onMouseDown={this.addComment}></i>
{this.state.isShowCommentDialog &&
<ReviewCommentDialog
toggleCommentDialog={this.toggleCommentDialog}
onCommentAdded={this.onCommentAdded}
selectedText={this.selectedText}
newIndex={this.newIndex}
oldIndex={this.oldIndex}
top={this.state.commentBtnTop}
/>
}
</div>
}
</div>
@@ -645,6 +629,15 @@ class DraftReview extends React.Component {
reviewers={this.state.reviewers}
/>
}
{this.state.isShowCommentDialog &&
<ReviewCommentDialog
toggleCommentDialog={this.toggleCommentDialog}
onCommentAdded={this.onCommentAdded}
selectedText={this.selectedText}
newIndex={this.newIndex}
oldIndex={this.oldIndex}
/>
}
</div>
);
}