mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
Fix a bug which cannot read a property when moves to other folder on locking
This commit is contained in:
@@ -82,7 +82,7 @@ class MarkdownEditor extends React.Component {
|
||||
this.refs.code.blur()
|
||||
this.refs.preview.focus()
|
||||
}
|
||||
eventEmitter.emit('topbar:togglelockbutton')
|
||||
eventEmitter.emit('topbar:togglelockbutton', this.state.status)
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -99,7 +99,7 @@ class MarkdownEditor extends React.Component {
|
||||
this.refs.preview.focus()
|
||||
this.refs.preview.scrollTo(cursorPosition.line)
|
||||
})
|
||||
eventEmitter.emit('topbar:togglelockbutton')
|
||||
eventEmitter.emit('topbar:togglelockbutton', this.state.status)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ class MarkdownEditor extends React.Component {
|
||||
}, () => {
|
||||
this.refs.code.focus()
|
||||
})
|
||||
eventEmitter.emit('topbar:togglelockbutton')
|
||||
eventEmitter.emit('topbar:togglelockbutton', this.state.status)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ class MarkdownEditor extends React.Component {
|
||||
} else {
|
||||
this.refs.code.focus()
|
||||
}
|
||||
eventEmitter.emit('topbar:togglelockbutton')
|
||||
eventEmitter.emit('topbar:togglelockbutton', this.state.status)
|
||||
}
|
||||
|
||||
reload () {
|
||||
|
||||
@@ -230,8 +230,9 @@ class MarkdownNoteDetail extends React.Component {
|
||||
if (e.keyCode === 27) this.handleDeleteCancelButtonClick(e)
|
||||
}
|
||||
|
||||
handleToggleLockButton () {
|
||||
if (this.props.config.editor.switchPreview === 'BLUR' && this.refs.content.state.status === 'CODE') {
|
||||
handleToggleLockButton (event, noteStatus) {
|
||||
// first argument event is not used
|
||||
if (this.props.config.editor.switchPreview === 'BLUR' && noteStatus === 'CODE') {
|
||||
this.setState({isLockButtonShown: true})
|
||||
} else {
|
||||
this.setState({isLockButtonShown: false})
|
||||
|
||||
Reference in New Issue
Block a user