Skip to content

Commit f042195

Browse files
authored
Merge pull request #5905 from influxdata/jts-fix-code-controls
fix(code-controls): Broken in code-blocks that contain the URL select…
2 parents de8e337 + 4d5aab9 commit f042195

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

assets/js/code-controls.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function initialize() {
6868
// Trigger copy failure state lifecycle
6969

7070
$('.copy-code').click(function () {
71-
let text = $(this).closest('.code-controls').prev('pre')[0].innerText;
71+
let text = $(this).closest('.code-controls').prevAll('pre:has(code)')[0].innerText;
7272

7373
const copyContent = async () => {
7474
try {
@@ -90,7 +90,7 @@ Disable scrolling on the body.
9090
Disable user selection on everything but the fullscreen codeblock.
9191
*/
9292
$('.fullscreen-toggle').click(function () {
93-
var code = $(this).closest('.code-controls').prev('pre').clone();
93+
var code = $(this).closest('.code-controls').prevAll('pre:has(code)').clone();
9494

9595
$('#fullscreen-code-placeholder').replaceWith(code[0]);
9696
$('body').css('overflow', 'hidden');

0 commit comments

Comments
 (0)