1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-23 22:51:42 +00:00
This commit is contained in:
Dick Choi
2016-07-23 15:41:30 +09:00
parent 45b1cd3942
commit 286739f770
7 changed files with 61 additions and 69 deletions

View File

@@ -13,16 +13,21 @@ class Detail extends React.Component {
super(props)
this.focusHandler = () => {
this.refs.root.focus()
this.refs.root != null && this.refs.root.focus()
}
this.deleteHandler = () => {
this.refs.root != null && this.refs.root.handleDeleteMenuClick()
}
}
componentDidMount () {
ee.on('detail:focus', this.focusHandler)
ee.on('detail:delete', this.deleteHandler)
}
componentWillUnmount () {
ee.off('detail:focus', this.focusHandler)
ee.off('detail:delete', this.deleteHandler)
}
render () {
@@ -46,7 +51,6 @@ class Detail extends React.Component {
<div styleName='root'
style={this.props.style}
tabIndex='0'
ref='root'
>
<div styleName='empty'>
<div styleName='empty-message'>{OSX ? 'Command(⌘)' : 'Ctrl(^)'} + N<br/>to create a new post</div>