1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-01-26 18:58:21 +02:00

Removed duplicate editor variable

This commit is contained in:
marcosvega91 2017-12-22 15:43:01 +01:00
parent 0bf5c9ebdd
commit 38c050b47e

View File

@ -36,8 +36,7 @@ class NoteTextComponent extends React.Component {
isLoading: true,
webviewReady: false,
scrollHeight: null,
editorScrollTop: 0,
editor:null
editorScrollTop: 0
};
this.lastLoadedNoteId_ = null;
@ -168,9 +167,8 @@ class NoteTextComponent extends React.Component {
async componentWillReceiveProps(nextProps) {
if ('noteId' in nextProps && nextProps.noteId !== this.props.noteId) {
await this.reloadNote(nextProps);
const editor=this.state.editor;
if(editor){
const session = editor.getSession();
if(this.editor_){
const session = this.editor_.editor.getSession();
const undoManager = session.getUndoManager();
undoManager.reset();
session.setUndoManager(undoManager);
@ -342,9 +340,6 @@ class NoteTextComponent extends React.Component {
this.scheduleSave();
}
aceEditor_onLoad(editor){
this.setState({editor:editor});
}
async commandAttachFile() {
const noteId = this.props.noteId;
@ -570,7 +565,6 @@ class NoteTextComponent extends React.Component {
height={editorStyle.height + 'px'}
fontSize={editorStyle.fontSize}
showGutter={false}
onLoad={editor => this.aceEditor_onLoad.bind(this)(editor)}
name="note-editor"
wrapEnabled={true}
onScroll={(event) => { this.editor_scroll(); }}