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

Fix from review

This commit is contained in:
asmsuechan
2017-02-18 12:18:55 +09:00
parent bbeeeccb31
commit aa0ad3bb70

View File

@@ -31,7 +31,7 @@ class MarkdownNoteDetail extends React.Component {
} }
this.dispatchTimer = null this.dispatchTimer = null
this.showLockButton = () => this.handleShowLockButton() this.showLockButton = this.handleShowLockButton.bind(this)
} }
focus () { focus () {
@@ -218,7 +218,7 @@ class MarkdownNoteDetail extends React.Component {
this.setState({ isLocked: !this.state.isLocked }) this.setState({ isLocked: !this.state.isLocked })
} }
toggleLockButton () { getToggleLockButton () {
return this.state.isLocked ? 'fa-lock' : 'fa-unlock-alt' return this.state.isLocked ? 'fa-lock' : 'fa-unlock-alt'
} }
@@ -266,17 +266,17 @@ class MarkdownNoteDetail extends React.Component {
</div> </div>
<div styleName='info-right'> <div styleName='info-right'>
{(() => { {(() => {
let faClassName=`fa ${this.toggleLockButton()}` const faClassName=`fa ${this.getToggleLockButton()}`
if (this.state.editorStatus === 'CODE') { const lockButtonComponent =
return( <button styleName='info-right-button'
<button styleName='info-right-button' onFocus={(e) => this.handleFocus(e)}
onFocus={(e) => this.handleFocus(e)} onMouseDown={(e) => this.handleLockButtonMouseDown(e)}
onMouseDown={(e) => this.handleLockButtonMouseDown(e)} >
> <i className={faClassName}/>
<i className={faClassName}/> </button>
</button> return (
) this.state.editorStatus === 'CODE' ? lockButtonComponent : ''
} )
})()} })()}
<button styleName='info-right-button' <button styleName='info-right-button'
onClick={(e) => this.handleContextButtonClick(e)} onClick={(e) => this.handleContextButtonClick(e)}