Skip to content
Snippets Groups Projects
Commit 417c7552 authored by Cam Saül's avatar Cam Saül
Browse files

Merge pull request #1120 from metabase/save-csv-on-osx

Wire up download button so it can work in Mac App
parents 64c58547 e4be85ce
Branches
Tags
No related merge requests found
......@@ -125,11 +125,22 @@ export default React.createClass({
renderDownloadButton: function() {
// NOTE: we expect our component provider set this to something falsey if download not available
if (this.props.downloadLink) {
return (
<a className="mx1" href={this.props.downloadLink} title="Download this data" target="_blank">
<Icon name='download' width="16px" height="16px" />
</a>
);
if (window.OSX) {
const downloadLink = this.props.downloadLink;
return (
<a classname="mx1" href="#" title="Download this data" onClick={function() {
window.OSX.saveCSV(downloadLink);
}}>
<Icon name='download' width="16px" height="16px" />
</a>
);
} else {
return (
<a className="mx1" href={this.props.downloadLink} title="Download this data" target="_blank">
<Icon name='download' width="16px" height="16px" />
</a>
);
}
}
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment