diff options
author | Corey Hulen <corey@hulen.com> | 2015-08-24 15:14:36 -0700 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2015-08-24 15:14:36 -0700 |
commit | 415ea0b5028ee4f26dd4301416459b1c6010b9bb (patch) | |
tree | e55ba4e5409913ee49876c35c65d851e9161721a /web/react/components/team_signup_send_invites_page.jsx | |
parent | 930488f002c819efed7e3afc982b73d1c06a9bbe (diff) | |
parent | 1464f4e4123543e01d59ad4a7d82925dcda20718 (diff) | |
download | chat-415ea0b5028ee4f26dd4301416459b1c6010b9bb.tar.gz chat-415ea0b5028ee4f26dd4301416459b1c6010b9bb.tar.bz2 chat-415ea0b5028ee4f26dd4301416459b1c6010b9bb.zip |
Merge pull request #459 from nickago/MM-1966
MM-1966 Re-enabled enter key submission for send invites page
Diffstat (limited to 'web/react/components/team_signup_send_invites_page.jsx')
-rw-r--r-- | web/react/components/team_signup_send_invites_page.jsx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/web/react/components/team_signup_send_invites_page.jsx b/web/react/components/team_signup_send_invites_page.jsx index a1e12661e..646a742ba 100644 --- a/web/react/components/team_signup_send_invites_page.jsx +++ b/web/react/components/team_signup_send_invites_page.jsx @@ -13,6 +13,7 @@ export default class TeamSignupSendInvitesPage extends React.Component { this.submitNext = this.submitNext.bind(this); this.submitAddInvite = this.submitAddInvite.bind(this); this.submitSkip = this.submitSkip.bind(this); + this.keySubmit = this.keySubmit.bind(this); this.state = { emailEnabled: !ConfigStore.getSettingAsBoolean('ByPassEmail', false) }; @@ -68,12 +69,28 @@ export default class TeamSignupSendInvitesPage extends React.Component { this.props.state.wizard = 'username'; this.props.updateParent(this.props.state); } + keySubmit(e) { + if (e && e.keyCode === 13) { + this.submitNext(e) + } + } componentWillMount() { if (!this.state.emailEnabled) { this.props.state.wizard = 'username'; this.props.updateParent(this.props.state); } } + componentDidMount() { + if (!this.state.emailEnabled) { + // Must use keypress not keyup due to event chain of pressing enter + $('body').keypress(this.keySubmit); + } + } + componentWillUnmount() { + if (!this.state.emailEnabled) { + $('body').off('keypress', this.keySubmit); + } + } render() { client.track('signup', 'signup_team_05_send_invites'); |