File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ class MarkdownEditor extends React.Component {
75
75
}
76
76
77
77
handleContextMenu ( e ) {
78
+ if ( this . state . isLocked ) return
78
79
const { config } = this . props
79
80
if ( config . editor . switchPreview === 'RIGHTCLICK' ) {
80
81
const newStatus = this . state . status === 'PREVIEW' ? 'CODE' : 'PREVIEW'
Original file line number Diff line number Diff line change @@ -292,7 +292,7 @@ class MarkdownNoteDetail extends React.Component {
292
292
293
293
handleToggleLockButton ( event , noteStatus ) {
294
294
// first argument event is not used
295
- if ( this . props . config . editor . switchPreview === 'BLUR' && noteStatus === 'CODE' ) {
295
+ if ( noteStatus === 'CODE' ) {
296
296
this . setState ( { isLockButtonShown : true } )
297
297
} else {
298
298
this . setState ( { isLockButtonShown : false } )
@@ -319,13 +319,14 @@ class MarkdownNoteDetail extends React.Component {
319
319
320
320
handleSwitchMode ( type ) {
321
321
// If in split mode, hide the lock button
322
- if ( type === 'SPLIT' ) this . setState ( { isLockButtonShown : false } )
323
- this . setState ( { editorType : type } , ( ) => {
322
+ this . setState ( { editorType : type , isLockButtonShown : ! ( type === 'SPLIT' ) } , ( ) => {
324
323
this . focus ( )
325
324
const newConfig = Object . assign ( { } , this . props . config )
326
325
newConfig . editor . type = type
327
326
ConfigManager . set ( newConfig )
328
327
} )
328
+
329
+ console . log ( this . state ) ;
329
330
}
330
331
331
332
handleDeleteNote ( ) {
You can’t perform that action at this time.
0 commit comments