mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-24 10:33:58 +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';
|
import LogMonitorEntry from './LogMonitorEntry';
|
||||||
|
|
||||||
export default class LogMonitor {
|
export default class LogMonitor {
|
||||||
|
constructor() {
|
||||||
|
window.addEventListener('keypress', ::this.handleKeyPress);
|
||||||
|
}
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
computedStates: PropTypes.array.isRequired,
|
computedStates: PropTypes.array.isRequired,
|
||||||
currentStateIndex: PropTypes.number.isRequired,
|
currentStateIndex: PropTypes.number.isRequired,
|
||||||
|
@ -66,6 +70,18 @@ export default class LogMonitor {
|
||||||
this.props.reset();
|
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() {
|
render() {
|
||||||
const elements = [];
|
const elements = [];
|
||||||
const { skippedActions, stagedActions, computedStates, select } = this.props;
|
const { skippedActions, stagedActions, computedStates, select } = this.props;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user