Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/components/crate-sidebar.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@
<p local-class="copy-help">Add the following line to your Cargo.toml file:</p>
{{#if (is-clipboard-supported)}}
<CopyButton
@copyText='{{@crate.name}} = "{{@version.num}}"'
@copyText={{this.tomlSnippet}}
title="Copy Cargo.toml snippet to clipboard"
local-class="copy-button"
>
<span>{{@crate.name}} = "{{@version.num}}"</span>
<span>{{this.tomlSnippet}}</span>
{{svg-jar "copy" aria-hidden="true" local-class="copy-icon"}}
</CopyButton>
{{else}}
<code local-class="copy-fallback">
{{@crate.name}} = "{{@version.num}}"
{{this.tomlSnippet}}
</code>
{{/if}}
</div>
Expand Down
4 changes: 4 additions & 0 deletions app/components/crate-sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@ export default class DownloadGraph extends Component {
}

@gt('sortedVersions.length', NUM_VERSIONS) hasMoreVersions;

get tomlSnippet() {
return `${this.args.crate.name} = "${this.args.version.num}"`;
}
}