File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change 11// Tightly coupled to `render-codeblock.html` for element targeting
2- const copyToClipBoard = ( ( clipboard ) => async ( button ) => {
3- const codeBlockId = button . getAttribute ( 'data-id-codeblock' ) ;
2+ const copyToClipBoard = ( ( clipboard ) => async ( button , codeBlockId ) => {
43 const codeBlock = document
54 . getElementById ( codeBlockId )
65 . getElementsByClassName ( 'highlight' ) [ 0 ] ;
Original file line number Diff line number Diff line change 66{{- if $isSingleLine -}}
77< div class ="code-block " data-mf ="true " style ="display: none; ">
88 < div class ="code-container ">
9- < button onclick ="copyToClipBoard(this) " data-id-codeblock =" {{ $codeBlockId }} " class ="code-copy-button " type ="button "> Copy</ button >
9+ < button onclick ="copyToClipBoard(this, {{ $codeBlockId }}) " class ="code-copy-button " type ="button "> Copy</ button >
1010 < div class ="highlight-v2 single-line " id ="{{ $codeBlockId }} ">
1111 {{ $result.Wrapped }}
1212 </ div >
1818 < span class ="code-type "> {{ .Type }}</ span >
1919 {{- end -}}
2020 < div class ="code-container ">
21- < button onclick ="copyToClipBoard(this) " data-id-codeblock =" {{ $codeBlockId }} " class ="code-copy-button multi-line " type ="button "> Copy</ button >
21+ < button onclick ="copyToClipBoard(this, {{ $codeBlockId }}) " class ="code-copy-button multi-line " type ="button "> Copy</ button >
2222 < div class ="highlight-v2 " id ="{{ $codeBlockId }} ">
2323 {{ $result.Wrapped }}
2424 </ div >
You can’t perform that action at this time.
0 commit comments