Skip to content

Commit

Permalink
Make entire menuitem clickable for copy query (#1747)
Browse files Browse the repository at this point in the history
  • Loading branch information
vera-liu authored Dec 5, 2016
1 parent 76aa9f7 commit 89fc9d7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ export default class CopyQueryTabUrl extends React.PureComponent {
<CopyToClipboard
inMenu
text={this.state.shortUrl}
copyNode={<span>share query</span>}
copyNode={(
<div>
<i className="fa fa-clipboard" /> <span>share query</span>
</div>
)}
tooltipText="copy URL to clipboard"
shouldShowText={false}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,7 @@ class TabbedSqlEditors extends React.PureComponent {
<i className="fa fa-i-cursor" /> rename tab
</MenuItem>
{qe &&
<MenuItem eventKey="3">
<i className="fa fa-clipboard" /> <CopyQueryTabUrl queryEditor={qe} />
</MenuItem>
<CopyQueryTabUrl queryEditor={qe} />
}
<MenuItem eventKey="4" onClick={this.toggleLeftBar.bind(this)}>
<i className="fa fa-cogs" />
Expand Down
16 changes: 9 additions & 7 deletions superset/assets/javascripts/components/CopyToClipboard.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { PropTypes } from 'react';
import { Tooltip, OverlayTrigger } from 'react-bootstrap';
import { Tooltip, OverlayTrigger, MenuItem } from 'react-bootstrap';

const propTypes = {
copyNode: PropTypes.node,
Expand Down Expand Up @@ -99,12 +99,14 @@ export default class CopyToClipboard extends React.Component {
renderInMenu() {
return (
<OverlayTrigger placement="top" overlay={this.renderTooltip()} trigger={['hover']}>
<span
onClick={this.copyToClipboard}
onMouseOut={this.onMouseOut}
>
{this.props.copyNode}
</span>
<MenuItem>
<span
onClick={this.copyToClipboard}
onMouseOut={this.onMouseOut}
>
{this.props.copyNode}
</span>
</MenuItem>
</OverlayTrigger>
);
}
Expand Down

0 comments on commit 89fc9d7

Please sign in to comment.