diff --git a/browser/components/MarkdownEditor.js b/browser/components/MarkdownEditor.js index f3bb92bb..e2bc5e23 100644 --- a/browser/components/MarkdownEditor.js +++ b/browser/components/MarkdownEditor.js @@ -19,10 +19,10 @@ class MarkdownEditor extends React.Component { this.supportMdSelectionBold = [16, 17, 186] this.state = { - status: props.config.editor.switchPreview === 'RIGHTCLICK' ? props.config.editor.delfaultStatus : 'PREVIEW', + status: props.config.editor.switchPreview === 'RIGHTCLICK' ? props.config.editor.delfaultStatus : 'CODE', renderValue: props.value, keyPressed: new Set(), - isLocked: false + isLocked: props.isLocked } this.lockEditorCode = () => this.handleLockEditor() diff --git a/browser/main/Detail/MarkdownNoteDetail.js b/browser/main/Detail/MarkdownNoteDetail.js index 116fdec0..588af9ae 100755 --- a/browser/main/Detail/MarkdownNoteDetail.js +++ b/browser/main/Detail/MarkdownNoteDetail.js @@ -288,6 +288,8 @@ class MarkdownNoteDetail extends React.Component { } handleSwitchMode (type) { + // If in split mode, hide the lock button + if (type === 'SPLIT') this.setState({isLockButtonShown: false}) this.setState({ editorType: type }, () => { this.focus() const newConfig = Object.assign({}, this.props.config) @@ -332,6 +334,7 @@ class MarkdownNoteDetail extends React.Component { storageKey={note.storage} noteKey={note.key} onChange={this.handleUpdateContent.bind(this)} + isLocked={this.state.isLocked} ignorePreviewPointerEvents={ignorePreviewPointerEvents} /> } else {