mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-23 06:31:51 +00:00
cmd+enter to confirm modal
This commit is contained in:
@@ -3,9 +3,23 @@ import ReactDOM from 'react-dom'
|
||||
import store from '../store'
|
||||
import { destroyArticle } from '../actions'
|
||||
|
||||
const electron = require('electron')
|
||||
const ipc = electron.ipcRenderer
|
||||
|
||||
export default class DeleteArticleModal extends React.Component {
|
||||
constructor (props) {
|
||||
super(props)
|
||||
|
||||
this.confirmHandler = e => this.handleYesButtonClick()
|
||||
}
|
||||
|
||||
componentDidMount () {
|
||||
ReactDOM.findDOMNode(this.refs.no).focus()
|
||||
ipc.on('modal-confirm', this.confirmHandler)
|
||||
}
|
||||
|
||||
componentWillUnmount () {
|
||||
ipc.removeListener('modal-confirm', this.confirmHandler)
|
||||
}
|
||||
|
||||
handleNoButtonClick (e) {
|
||||
|
||||
Reference in New Issue
Block a user