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
commit
f0421955c8
|
@ -68,7 +68,7 @@ function initialize() {
|
||||||
// Trigger copy failure state lifecycle
|
// Trigger copy failure state lifecycle
|
||||||
|
|
||||||
$('.copy-code').click(function () {
|
$('.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 () => {
|
const copyContent = async () => {
|
||||||
try {
|
try {
|
||||||
|
@ -90,7 +90,7 @@ Disable scrolling on the body.
|
||||||
Disable user selection on everything but the fullscreen codeblock.
|
Disable user selection on everything but the fullscreen codeblock.
|
||||||
*/
|
*/
|
||||||
$('.fullscreen-toggle').click(function () {
|
$('.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]);
|
$('#fullscreen-code-placeholder').replaceWith(code[0]);
|
||||||
$('body').css('overflow', 'hidden');
|
$('body').css('overflow', 'hidden');
|
||||||
|
|
Loading…
Reference in New Issue