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

Change a name showlockbutton to togglelockbutton

This commit is contained in:
asmsuechan
2017-03-17 23:32:44 -07:00
parent 4767f15e9b
commit 8a5558db55
2 changed files with 8 additions and 8 deletions

View File

@@ -82,7 +82,7 @@ class MarkdownEditor extends React.Component {
this.refs.code.blur() this.refs.code.blur()
this.refs.preview.focus() this.refs.preview.focus()
} }
eventEmitter.emit('topbar:showlockbutton') eventEmitter.emit('topbar:togglelockbutton')
}) })
} }
} }
@@ -99,7 +99,7 @@ class MarkdownEditor extends React.Component {
this.refs.preview.focus() this.refs.preview.focus()
this.refs.preview.scrollTo(cursorPosition.line) this.refs.preview.scrollTo(cursorPosition.line)
}) })
eventEmitter.emit('topbar:showlockbutton') eventEmitter.emit('topbar:togglelockbutton')
} }
} }
@@ -115,7 +115,7 @@ class MarkdownEditor extends React.Component {
}, () => { }, () => {
this.refs.code.focus() this.refs.code.focus()
}) })
eventEmitter.emit('topbar:showlockbutton') eventEmitter.emit('topbar:togglelockbutton')
} }
} }
@@ -152,7 +152,7 @@ class MarkdownEditor extends React.Component {
} else { } else {
this.refs.code.focus() this.refs.code.focus()
} }
eventEmitter.emit('topbar:showlockbutton') eventEmitter.emit('topbar:togglelockbutton')
} }
reload () { reload () {

View File

@@ -31,7 +31,7 @@ class MarkdownNoteDetail extends React.Component {
} }
this.dispatchTimer = null this.dispatchTimer = null
this.showLockButton = this.handleShowLockButton.bind(this) this.toggleLockButton = this.handleToggleLockButton.bind(this)
} }
focus () { focus () {
@@ -39,7 +39,7 @@ class MarkdownNoteDetail extends React.Component {
} }
componentDidMount () { componentDidMount () {
ee.on('topbar:showlockbutton', this.showLockButton) ee.on('topbar:togglelockbutton', this.toggleLockButton)
} }
componentWillReceiveProps (nextProps) { componentWillReceiveProps (nextProps) {
@@ -59,7 +59,7 @@ class MarkdownNoteDetail extends React.Component {
} }
componentDidUnmount () { componentDidUnmount () {
ee.off('topbar:lock', this.showLockButton) ee.off('topbar:togglelockbutton', this.toggleLockButton)
} }
findTitle (value) { findTitle (value) {
@@ -230,7 +230,7 @@ class MarkdownNoteDetail extends React.Component {
if (e.keyCode === 27) this.handleDeleteCancelButtonClick(e) if (e.keyCode === 27) this.handleDeleteCancelButtonClick(e)
} }
handleShowLockButton () { handleToggleLockButton () {
this.setState({editorStatus: this.refs.content.state.status}) this.setState({editorStatus: this.refs.content.state.status})
} }