mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-10 19:56:54 +03:00
Add handleKeyPress event
This commit is contained in:
parent
64dcb3cc17
commit
4a2a59d676
|
@ -2,6 +2,10 @@ import React, { PropTypes, findDOMNode } from 'react';
|
|||
import LogMonitorEntry from './LogMonitorEntry';
|
||||
|
||||
export default class LogMonitor {
|
||||
constructor() {
|
||||
window.addEventListener('keypress', ::this.handleKeyPress);
|
||||
}
|
||||
|
||||
static propTypes = {
|
||||
computedStates: PropTypes.array.isRequired,
|
||||
currentStateIndex: PropTypes.number.isRequired,
|
||||
|
@ -66,6 +70,18 @@ export default class LogMonitor {
|
|||
this.props.reset();
|
||||
}
|
||||
|
||||
handleKeyPress(event) {
|
||||
let { isVisible } = this.props.monitorState;
|
||||
|
||||
if (event.ctrlKey && event.keyCode === 8) {
|
||||
if (isVisible) {
|
||||
this.props.hide();
|
||||
} else {
|
||||
this.props.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const elements = [];
|
||||
const { skippedActions, stagedActions, computedStates, select } = this.props;
|
||||
|
|
Loading…
Reference in New Issue
Block a user