Skip to content

Commit

Permalink
replace ReactZeroClipboard with React Copy-to-clipboard, a Flash-less…
Browse files Browse the repository at this point in the history
…, CDN-less, lighter option
  • Loading branch information
pmusaraj committed Sep 27, 2016
1 parent afd5d40 commit 585704e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
10 changes: 6 additions & 4 deletions jsapp/js/mixins.es6
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import alertify from 'alertifyjs';
import {Link} from 'react-router';
import mdl from './libs/rest_framework/material';
import TagsInput from 'react-tagsinput';
import ReactZeroClipboard from 'react-zeroclipboard';
import CopyToClipboard from 'react-copy-to-clipboard';
import DocumentTitle from 'react-document-title';

import {dataInterface} from './dataInterface';
Expand Down Expand Up @@ -500,9 +500,11 @@ var dmix = {

{this.state.selectedCollectOption.value ?
<bem.FormView__item m={'collect-links'}>
<ReactZeroClipboard text={this.state.selectedCollectOption.value} onAfterCopy={this.afterCopy}>
<a className="copy">copy</a>
</ReactZeroClipboard>
<CopyToClipboard text={this.state.selectedCollectOption.value}
onCopy={() => notify('copied to clipboard')}>
<a className="copy">Copy</a>
</CopyToClipboard>

{this.state.selectedCollectOption.key != 'iframe_url' ?
<a href={this.state.selectedCollectOption.value} target="_blank" className="open">
{t('Open')}
Expand Down
1 change: 1 addition & 0 deletions jsapp/scss/components/_kobo.form-view.scss
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@
padding:4px 16px;
text-transform: uppercase;
display: inline-block;
cursor: pointer;
&.copy {
color:$cool-gray;
transition:all 0.5s;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@
"q": "^1.4.1",
"react": "^0.13.3",
"react-cookie": "^0.2.3",
"react-copy-to-clipboard": "^3.0.2",
"react-document-title": "^1.0.2",
"react-favicon": "0.0.3",
"react-hot-loader": "^1.3.0",
"react-router": "^0.13.3",
"react-select": "^0.6.3",
"react-tagsinput": "1.4.x",
"react-zeroclipboard": "^1.1.0",
"reflux": "^0.2.7",
"rimraf": "^2.4.3",
"roboto-fontface": "^0.4.5",
Expand Down

0 comments on commit 585704e

Please sign in to comment.