Merge pull request #23966 from kbhawkey/kb-fix-copy-clipboard

fix copy to clipboard
This commit is contained in:
Kubernetes Prow Robot 2020-09-20 12:08:29 -07:00 committed by GitHub
commit c7ac12656c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 6 deletions

View File

@ -19,11 +19,14 @@
{{ end }}
{{ with $.Scratch.Get "content" }}
<div class="highlight">
<div class="includecode" style="text-align: right" id="{{- $file | anchorize -}}">
{{- with $ghlink -}}<a href="{{ . }}" download="{{ $file }}">{{- end -}}
<code>{{ $file }}</code>
{{ if $ghlink }}</a>{{ end }}<img src="{{ "images/copycode.svg" | relURL }}" style="max-height:24px; cursor: pointer" onclick="copyCode('{{ $file | anchorize }}')" title="Copy {{ $file }} to clipboard">
<div class="copy-code-icon" style="text-align:right">
{{ with $ghlink }}<a href="{{ . }}" download="{{ $file }}">{{ end }}<code>{{ $file }}</code>
{{ if $ghlink }}</a>{{ end }}
<img src="{{ "images/copycode.svg" | relURL }}" style="max-height:24px; cursor: pointer" onclick="copyCode('{{ $file | anchorize }}')" title="Copy {{ $file }} to clipboard">
</img>
</div>
<div class="includecode" id="{{ $file | anchorize }}">
{{ highlight . $codelang "" }}
</div>
{{- end -}}
</div>
{{ end }}