diff --git a/browser/components/MarkdownEditor.js b/browser/components/MarkdownEditor.js index 8c798159..65fdb1bc 100644 --- a/browser/components/MarkdownEditor.js +++ b/browser/components/MarkdownEditor.js @@ -75,6 +75,7 @@ class MarkdownEditor extends React.Component { } handleContextMenu (e) { + if (this.state.isLocked) return const { config } = this.props if (config.editor.switchPreview === 'RIGHTCLICK') { const newStatus = this.state.status === 'PREVIEW' ? 'CODE' : 'PREVIEW' diff --git a/browser/main/Detail/MarkdownNoteDetail.js b/browser/main/Detail/MarkdownNoteDetail.js index aefcc614..bcb79b8e 100755 --- a/browser/main/Detail/MarkdownNoteDetail.js +++ b/browser/main/Detail/MarkdownNoteDetail.js @@ -292,7 +292,7 @@ class MarkdownNoteDetail extends React.Component { handleToggleLockButton (event, noteStatus) { // first argument event is not used - if (this.props.config.editor.switchPreview === 'BLUR' && noteStatus === 'CODE') { + if (noteStatus === 'CODE') { this.setState({isLockButtonShown: true}) } else { this.setState({isLockButtonShown: false}) @@ -319,13 +319,14 @@ 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.setState({ editorType: type, isLockButtonShown: !(type === 'SPLIT') }, () => { this.focus() const newConfig = Object.assign({}, this.props.config) newConfig.editor.type = type ConfigManager.set(newConfig) }) + + console.log(this.state); } handleDeleteNote () {