mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-19 18:29:23 +00:00
optimize code
This commit is contained in:
@@ -40,7 +40,6 @@ class SeafileEditor extends React.Component {
|
|||||||
const { mode, markdownContent, isDraft } = this.props;
|
const { mode, markdownContent, isDraft } = this.props;
|
||||||
const isEditMode = mode === 'editor' || isDraft;
|
const isEditMode = mode === 'editor' || isDraft;
|
||||||
const richValue = isEditMode ? deserialize(markdownContent) : deserialize('');
|
const richValue = isEditMode ? deserialize(markdownContent) : deserialize('');
|
||||||
console.log(richValue);
|
|
||||||
this.state = {
|
this.state = {
|
||||||
initialPlainValue: '',
|
initialPlainValue: '',
|
||||||
currentContent: markdownContent,
|
currentContent: markdownContent,
|
||||||
@@ -56,7 +55,6 @@ class SeafileEditor extends React.Component {
|
|||||||
componentWillMount() {
|
componentWillMount() {
|
||||||
if (this.props.editorMode === 'rich') {
|
if (this.props.editorMode === 'rich') {
|
||||||
const document = this.state.richValue;
|
const document = this.state.richValue;
|
||||||
console.log(document, 'dadad');
|
|
||||||
const firstNode = document[0];
|
const firstNode = document[0];
|
||||||
/**
|
/**
|
||||||
* if the markdown content is empty, the rich value contains
|
* if the markdown content is empty, the rich value contains
|
||||||
|
Reference in New Issue
Block a user