Merge pull request #5905 from influxdata/jts-fix-code-controls

fix(code-controls): Broken in code-blocks that contain the URL select…
jts-ai-instruction
Jason Stirnaman 2025-03-17 14:34:20 -05:00 committed by GitHub
commit f0421955c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -68,7 +68,7 @@ function initialize() {
// Trigger copy failure state lifecycle
$('.copy-code').click(function () {
let text = $(this).closest('.code-controls').prev('pre')[0].innerText;
let text = $(this).closest('.code-controls').prevAll('pre:has(code)')[0].innerText;
const copyContent = async () => {
try {
@ -90,7 +90,7 @@ Disable scrolling on the body.
Disable user selection on everything but the fullscreen codeblock.
*/
$('.fullscreen-toggle').click(function () {
var code = $(this).closest('.code-controls').prev('pre').clone();
var code = $(this).closest('.code-controls').prevAll('pre:has(code)').clone();
$('#fullscreen-code-placeholder').replaceWith(code[0]);
$('body').css('overflow', 'hidden');