diff options
author | Ryan Wang <R-Wang97@users.noreply.github.com> | 2017-03-13 16:36:10 -0400 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2017-03-13 13:36:10 -0700 |
commit | 33c1609aa47b5bb01a594aeb07a742d683866ffd (patch) | |
tree | 38609076d32b9e0391f404ece0e4fa3991d952a0 /webapp/components/integrations | |
parent | 3cbe05e0f48673adf0306cc1fcb97eb224c375ac (diff) | |
download | chat-33c1609aa47b5bb01a594aeb07a742d683866ffd.tar.gz chat-33c1609aa47b5bb01a594aeb07a742d683866ffd.tar.bz2 chat-33c1609aa47b5bb01a594aeb07a742d683866ffd.zip |
Close confirm_integration On Enter Keypress (#5600)
Diffstat (limited to 'webapp/components/integrations')
-rw-r--r-- | webapp/components/integrations/components/confirm_integration.jsx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/webapp/components/integrations/components/confirm_integration.jsx b/webapp/components/integrations/components/confirm_integration.jsx index 6d778f241..b4f299d1c 100644 --- a/webapp/components/integrations/components/confirm_integration.jsx +++ b/webapp/components/integrations/components/confirm_integration.jsx @@ -5,7 +5,7 @@ import React from 'react'; import BackstageHeader from 'components/backstage/components/backstage_header.jsx'; import {FormattedMessage, FormattedHTMLMessage} from 'react-intl'; -import {Link} from 'react-router/es6'; +import {Link, browserHistory} from 'react-router/es6'; import UserStore from 'stores/user_store.jsx'; import IntegrationStore from 'stores/integration_store.jsx'; @@ -25,6 +25,7 @@ export default class ConfirmIntegration extends React.Component { super(props); this.handleIntegrationChange = this.handleIntegrationChange.bind(this); + this.handleKeyPress = this.handleKeyPress.bind(this); const userId = UserStore.getCurrentId(); @@ -38,10 +39,12 @@ export default class ConfirmIntegration extends React.Component { componentDidMount() { IntegrationStore.addChangeListener(this.handleIntegrationChange); + window.addEventListener('keypress', this.handleKeyPress); } componentWillUnmount() { IntegrationStore.removeChangeListener(this.handleIntegrationChange); + window.removeEventListener('keypress', this.handleKeyPress); } handleIntegrationChange() { @@ -53,6 +56,12 @@ export default class ConfirmIntegration extends React.Component { }); } + handleKeyPress(e) { + if (e.key === 'Enter') { + browserHistory.push('/' + this.props.team.name + '/integrations/' + this.state.type); + } + } + render() { let headerText = null; let helpText = null; |