1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

Fixed lock button behaviour and display

This commit is contained in:
Miguel Teixeira
2018-11-29 17:06:28 +00:00
parent b703c42ee3
commit aa20bc769c
2 changed files with 5 additions and 2 deletions

View File

@@ -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()

View File

@@ -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 {