1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-06 01:12:03 +00:00

update codes for slate (#3170)

This commit is contained in:
Michael An
2019-03-25 11:49:47 +08:00
committed by Daniel Pan
parent 8dec69ca4b
commit 774143554f
3 changed files with 16 additions and 6 deletions

View File

@@ -752,11 +752,13 @@ class MarkdownEditor extends React.Component {
newNativeRange.setStartBefore(startNode);
newNativeRange.setEndAfter(startNode);
this.range = findRange(newNativeRange, this.state.value);
let editor = {value: this.state.value};
this.range = findRange(nativeRange, editor);
}
else {
this.range = findRange(nativeRange, this.state.value);
let editor = {value: this.state.value};
this.range = findRange(nativeRange, editor);
}
if (!this.range) return;
let rect = nativeRange.getBoundingClientRect();
@@ -1011,7 +1013,8 @@ class MarkdownEditor extends React.Component {
scrollToNode={this.scrollToNode}
/>
}
{this.state.isShowComments && <CommentPanel toggleCommentPanel={this.toggleCommentList}/>}
{this.state.isShowComments &&
<CommentPanel toggleCommentPanel={this.toggleCommentList} commentsNumber={this.state.commentsNumber}/>}
</div>
<div className="seafile-md-viewer-side-panel">
{