1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

Fixed issue with double and right click

This commit is contained in:
Miguel Teixeira
2018-12-13 19:09:41 +00:00
parent 3b110bcd4b
commit 37340d0445
2 changed files with 5 additions and 3 deletions

View File

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