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

Change a state name editorStatus to isLockButtonShown

This commit is contained in:
asmsuechan
2017-03-17 23:37:22 -07:00
parent 8a5558db55
commit e7fd18967b

View File

@@ -26,7 +26,7 @@ class MarkdownNoteDetail extends React.Component {
title: '',
content: ''
}, props.note),
editorStatus: false,
isLockButtonShown: false,
isLocked: false
}
this.dispatchTimer = null
@@ -231,7 +231,11 @@ class MarkdownNoteDetail extends React.Component {
}
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) {
@@ -279,7 +283,7 @@ class MarkdownNoteDetail extends React.Component {
<i className={faClassName}/>
</button>
return (
this.state.editorStatus === 'CODE' ? lockButtonComponent : ''
this.state.isLockButtonShown ? lockButtonComponent : ''
)
})()}
<button styleName='info-right-button'