1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +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

@@ -5,6 +5,7 @@ import _ from 'lodash'
import modal from 'browser/main/lib/modal'
import NewNoteModal from 'browser/main/modals/NewNoteModal'
import { hashHistory } from 'react-router'
import ee from 'browser/main/lib/eventEmitter'
const OSX = window.process.platform === 'darwin'
@@ -17,6 +18,18 @@ class TopBar extends React.Component {
searchOptions: [],
searchPopupOpen: false
}
this.newNoteHandler = () => {
this.handleNewPostButtonClick()
}
}
componentDidMount () {
ee.on('top:new-note', this.newNoteHandler)
}
componentWillUnmount () {
ee.off('top:new-note', this.newNoteHandler)
}
handleNewPostButtonClick (e) {