mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-17 03:31:52 +00:00
Change a state name editorStatus to isLockButtonShown
This commit is contained in:
@@ -26,7 +26,7 @@ class MarkdownNoteDetail extends React.Component {
|
|||||||
title: '',
|
title: '',
|
||||||
content: ''
|
content: ''
|
||||||
}, props.note),
|
}, props.note),
|
||||||
editorStatus: false,
|
isLockButtonShown: false,
|
||||||
isLocked: false
|
isLocked: false
|
||||||
}
|
}
|
||||||
this.dispatchTimer = null
|
this.dispatchTimer = null
|
||||||
@@ -231,7 +231,11 @@ class MarkdownNoteDetail extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleToggleLockButton () {
|
handleToggleLockButton () {
|
||||||
this.setState({editorStatus: this.refs.content.state.status})
|
if (this.refs.content.state.status === 'CODE') {
|
||||||
|
this.setState({isLockButtonShown: true})
|
||||||
|
} else {
|
||||||
|
this.setState({isLockButtonShown: false})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
handleFocus (e) {
|
handleFocus (e) {
|
||||||
@@ -279,7 +283,7 @@ class MarkdownNoteDetail extends React.Component {
|
|||||||
<i className={faClassName}/>
|
<i className={faClassName}/>
|
||||||
</button>
|
</button>
|
||||||
return (
|
return (
|
||||||
this.state.editorStatus === 'CODE' ? lockButtonComponent : ''
|
this.state.isLockButtonShown ? lockButtonComponent : ''
|
||||||
)
|
)
|
||||||
})()}
|
})()}
|
||||||
<button styleName='info-right-button'
|
<button styleName='info-right-button'
|
||||||
|
|||||||
Reference in New Issue
Block a user