From 300f25b31b99894bbbf95f5974d7f775d8f7ff29 Mon Sep 17 00:00:00 2001 From: hmhealey Date: Tue, 6 Oct 2015 10:45:49 -0400 Subject: Hid Copy Link button when unable to copy the team signup link --- web/react/components/get_link_modal.jsx | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/web/react/components/get_link_modal.jsx b/web/react/components/get_link_modal.jsx index 1d4aac3e6..6e0728862 100644 --- a/web/react/components/get_link_modal.jsx +++ b/web/react/components/get_link_modal.jsx @@ -23,7 +23,7 @@ export default class GetLinkModal extends React.Component { componentDidMount() { if (this.refs.modal) { $(React.findDOMNode(this.refs.modal)).on('show.bs.modal', this.onShow); - $(React.findDOMNode(this.refs.modal)).on('hide.bs.modal', this.onShow); + $(React.findDOMNode(this.refs.modal)).on('hide.bs.modal', this.onHide); } } handleClick() { @@ -43,8 +43,23 @@ export default class GetLinkModal extends React.Component { } render() { var currentUser = UserStore.getCurrentUser(); - var copyLinkConfirm = null; + let copyLink = null; + if (document.queryCommandSupported('copy')) { + copyLink = ( + + ); + } + + var copyLinkConfirm = null; if (this.state.copiedLink) { copyLinkConfirm =

Link copied to clipboard.

; } @@ -98,15 +113,7 @@ export default class GetLinkModal extends React.Component { > Close - + {copyLink} {copyLinkConfirm} -- cgit v1.2.3-1-g7c22