Clean up and smaller bundle.js

This commit is contained in:
Jori Lallo
2016-06-05 14:38:14 -07:00
parent 2a84d1fc67
commit 6303bc9279
7 changed files with 5 additions and 26 deletions

View File

@@ -25,7 +25,6 @@ class DocumentEdit extends Component {
EditorLoader()
.then(({ Editor }) => {
console.log("loaded", Editor);
this.setState({ Editor });
});
}

View File

@@ -1,7 +1,6 @@
import { observable, action, computed, autorun } from 'mobx';
import { client } from 'utils/ApiClient';
import localforage from 'localforage';
import { convertToMarkdown } from 'utils/markdown';
import { browserHistory } from 'react-router'
const DOCUMENT_EDIT_SETTINGS = 'DOCUMENT_EDIT_SETTINGS';
@@ -24,15 +23,6 @@ const documentEditState = new class DocumentEditState {
@observable isFetching;
@observable isSaving;
/* Computed */
@computed get htmlPreview() {
// Only compute if preview is active
if (this.preview) {
return convertToMarkdown(this.text);
}
}
/* Actions */
@action fetchDocument = async () => {

View File

@@ -1,5 +1,6 @@
import React from 'react';
import { observer } from 'mobx-react';
import { convertToMarkdown } from 'utils/markdown';
import MarkdownEditor from 'components/MarkdownEditor';
import Preview from './Preview';
@@ -27,7 +28,7 @@ const Editor = observer((props) => {
<EditorPane
scrollTop={ props.scrollTop }
>
<Preview html={ store.htmlPreview } />
<Preview html={ store.text } />
</EditorPane>
) : null }
</div>

View File

@@ -9,7 +9,7 @@ const cx = classNames.bind(styles);
const Preview = (props) => {
return (
<div className={ styles.preview }>
<DocumentHtml html={ props.html } />
<DocumentHtml html={ props.html } />
</div>
);
};