mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-15 18:56:22 +00:00
add hotkey
This commit is contained in:
@@ -17,8 +17,19 @@ var PlanetNavigator = React.createClass({
|
||||
isLaunchModalOpen: false
|
||||
}
|
||||
},
|
||||
handleKeyDown: function (e) {
|
||||
if (e.keyCode === 13 && e.metaKey) {
|
||||
e.preventDefault()
|
||||
this.openLaunchModal()
|
||||
}
|
||||
},
|
||||
componentDidMount: function () {
|
||||
document.addEventListener('keydown', this.handleKeyDown, false)
|
||||
},
|
||||
componentWillUnmount: function () {
|
||||
document.removeEventListener('keydown', this.handleKeyDown, false)
|
||||
},
|
||||
openLaunchModal: function () {
|
||||
console.log('and...OPEN!!')
|
||||
this.setState({isLaunchModalOpen: true})
|
||||
},
|
||||
closeLaunchModal: function () {
|
||||
|
||||
Reference in New Issue
Block a user