diff --git a/src/react/LogMonitor.js b/src/react/LogMonitor.js index 8f45829a..bb27389f 100644 --- a/src/react/LogMonitor.js +++ b/src/react/LogMonitor.js @@ -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;